Upgrading Smile CDR is a critical part of using the software. The team is constantly working on improving performance, fixing bugs, and adding new features. To take advantage of these developments in Smile CDR, it is critical to have an operational plan on how you will be upgrading your Smile CDR cluster to a newer version. This document discusses the various concepts, modes, and mechanisms that are related to upgrading.
An upgrade is when you update your installation to a newer version of the software, as well as a newer version of the database schema.
For the purposes of discussion we will use the following terms when we talk about upgrading:
lib/
/bin/
, and /otel
directories in an installation of Smile CDR.This page will cover all the information needed to understand which upgrade mode and which database migration mechanism is suitable for your use case.
Depending on how you've installed Smile CDR, the upgrade process will differ.
Upgrading the binaries consists of replacing the contents of the bin/
, /lib
/otel
directories with newer versions. If however you are using the docker container, it is sufficient to upgrade the image you are using to the newer version,
while keeping your volume mounts intact.
Migrating the database consists of applying schema changes to the database. This can include, but isn't limited to:
There are three database migration mechanisms:
The choice of database migration mecahnism does not impact your choice of upgrade mode. These are independent choices, and both online and offline upgrades can be done via any of the defined database migration mechanisms.
There are two upgrade modes, which determine whether your Smile CDR cluster remains available during upgrade:
An offline mode upgrade can only occur when all Smile CDR processes in your cluster are shut down. When this can be achieved, Smile CDR may be upgraded to any arbitrary future version. The following table shows some examples of start and end versions for an offline upgrade.
Example Upgrade Paths:
Start Version | End Version | Notes |
---|---|---|
2023.02.RXX | 2023.05.RXX | Upgrade by one major version |
2023.08.RXX | 2024.02.RXX | Upgrade by two major versions |
2021.02.RXX | 2024.05.RXX | Upgrade by thirteen major versions |
Each row in this table represents an example migration from a given version to another version. The advantage to an offline upgrade is that Smile can be upgraded an arbitrary number of versions, all at once in a single jump. The tradeoff is that it requires downtime.
Pros | Cons |
---|---|
Allows upgrade to any future release with no intermediate steps | Cluster must be taken fully offline, and cannot service requests |
Operationally Simple |
2021.02
An Online Mode
upgrade that means that your cluster will be able to continue servicing requests during the upgrade. There will be no downtime for users who connect to your Smile CDR cluster.
In order to perform an Online Mode upgrade, several preconditions must be met:
2021.02.R05
or later on all servers in your clusterYou must be able to handle incoming request load on a subset of servers during the upgrade process, as the processes being upgraded will be unable to handle requests.
During an online upgrade, FHIR Requests, OIDC requests, and others will continue to be serviced, but some functionality is unavailable:
In order to enforce some of these behaviours, you may set an environment variable on the system running Smile CDR in order to ensure these behaviours:
export CDR_UPGRADE_MODE=true
Usage of the CDR_UPGRADE_MODE
system property is available from 2024.02.R01
onwards. It causes Smile CDR to:
Once upgrading is complete, those processes can be restarted without this environment variable. This is not mandatory for online upgrades, but ensures that jobs will be processed on the versions of the software on which they were submitted.
This below table outlines a "zero downtime" upgrade path, to get from version 2022.11
to 2025.02
(e.g. over 2 years of generally available releases)
Each row in this table represents a single migration event, in which the entire cluster is upgraded.
Start Version | Target Version |
---|---|
2022.11.RXX | 2023.05.RXX |
2023.05.RXX | 2023.11.RXX |
2023.11.RXX | 2024.05.RXX |
2024.05.RXX | 2024.11.RXX |
2024.11.RXX | 2025.02.RXX |
The cluster in this example starts at 2022.11 The migration to 2023.05 is the first step, as that is two releases ahead of the starting point (2022.11 2023.02 2023.05). Once that migration has been completed and all processes are running 2023.05, the next stage can begin. That stage consists of upgrading all processes in the cluster to 2023.11. This process is repeated until your target version is achieved across the cluster, and every process is now running 2025.02.
Pros | Cons |
---|---|
Able to service most user requests during upgrade | Can only upgrade two Generally Available release versions at a time, so can require multiple intermediate steps in cases where you want to upgrade more than two versions at a time |
Operationally Complex |
Now that we know about upgrade modes, we can discuss the operational methods by which the database migration can occur. These are the actual commands that need to be run in order to migrate the database. There are currently three options to select from:
This is the recommended approach for production environments using the command-line migration utility. This method:
The documentation for the command covers all the relevant options.
As of 2024.11.R01, you may run bin/smilecdr migrate
on an existing Smile CDR process. This command will bootstrap its configuration from the properties file or the database, depending on your node.propertysource setting.
The advantage of this method over the [smileutil migrate-database] command is that credentials, database type, and modules are bootstrapped from the cluster, and do not have to be provided at runtime.
This command currently supports the --dry-run
and --enable-heavyweight-migrations
flags defined in the smileutil migrate-database options, and will support more flags in the future.
This does not require you to authenticate to the database, nor does it require you to select the driver type or schema type. When using this command, all of that information is determined from your current live configuration.
This mechanism is only supported for backwards compatibility. It is not recommended to use this upgrade mode, on a production installation.
Available since version 2020.11.R01, this mechanism:
This can be enabled by setting the db.schema.update_mode property to UPDATE
.
When starting, a Smile CDR process will check if there are any new migrations to be run, and if it finds any, it will run them before continuing its normal boot sequence.
[Video content to be added]