Upgrade an Active-Active database
How to upgrade an Active-Active database.
| Redis Software |
|---|
You can upgrade an Active-Active database (formerly known as CRDB) in one of two ways.
-
Coordinated upgrade: Send a single upgrade request with
crdb-clior the REST API. The request upgrades the database on each participating cluster in the Active-Active database, so you don't need to upgrade each one separately. Requires Redis Software version 8.0.18 or later on all participating clusters. This is the recommended upgrade method. -
Manual upgrade: Upgrade the database on each participating cluster separately with
rladmin, then update the feature set version and module information withcrdb-cli.
Default Redis database versions
When you upgrade an Active-Active database, it uses the latest Redis version bundled with Redis Software unless you specify a different version.
For the default Redis database version of each Redis Software release, see Default Redis database versions.
Upgrade prerequisites
Before upgrading an Active-Active database:
-
Review the relevant release notes for any preparation instructions.
-
Upgrade Redis Software on each node of every participating cluster in the Active-Active database. A coordinated upgrade requires Redis Software version 8.0.18 or later on all participating clusters.
-
Verify that the target database version is supported by the Redis Software version of every participating cluster.
-
Check the status of the Active-Active database on each participating cluster.
-
Check that your client libraries are compatible with the new Redis database version. See the database upgrade prerequisites for details.
-
To avoid data loss during the upgrade, back up your data.
Run a coordinated upgrade
To upgrade the database on all participating clusters with a single request:
-
Complete all prerequisites before starting the upgrade.
-
Find the
<CRDB-GUID>of your Active-Active database with thecrdb-cli crdb listcommand:crdb-cli crdb listLook for the fully qualified domain name (
CLUSTER-FQDN) of your cluster and use the associatedGUID:CRDB-GUID NAME REPL-ID CLUSTER-FQDN 700140c5-478e-49d7-ad3c-64d517ddc486 aatest 1 aatest1.example.com 700140c5-478e-49d7-ad3c-64d517ddc486 aatest 2 aatest2.example.com -
Upgrade the Active-Active database with
crdb-cli crdb upgrade. Use the--preserve-rolesoption to keep the current primary shard placement and prevent the clusters from becoming unbalanced.crdb-cli crdb upgrade --crdb-guid <CRDB-GUID> --preserve-rolesTo upgrade the database to a version other than the default version, use the
--redis-versionoption:crdb-cli crdb upgrade --crdb-guid <CRDB-GUID> --redis-version <version> --preserve-rolesFor additional options, see the
crdb-cli crdb upgradeparameters.By default, the command waits for the upgrade to finish and reports status changes:
$ crdb-cli crdb upgrade --crdb-guid <CRDB-GUID> --preserve-roles Task <task-id> created ---> CRDB GUID Assigned: crdb:<CRDB-GUID> ---> Status changed: queued -> started ---> Status changed: started -> finishedIf you use
--no-wait, check the upgrade's progress withcrdb-cli task status:crdb-cli task status --task-id <task-id> -
Use
rladmin status databases extra allon each participating cluster to verify that the Redis version is set to the expected value.rladmin status databases extra all
Run a manual upgrade
A manual upgrade upgrades the database on one participating cluster at a time. To avoid temporary inconsistencies between participating clusters, upgrade the database on all of them within a reasonable time frame. Finish the upgrade on all participating clusters before you perform global operations on the Active-Active database, such as adding or removing participating clusters.
To upgrade an Active-Active database manually:
-
Upgrade Redis Software on each node of every participating cluster in the Active-Active database.
-
Check the status of the Active-Active database on each participating cluster.
-
On each participating cluster, upgrade the Redis version and modules of the database with
rladmin upgrade db:rladmin upgrade db { db:<ID> | <database-name> }If the CRDB protocol version is old, read the warning message carefully and confirm that you want to update the CRDB protocol version. See CRDB protocol version guidelines for more information.
After you confirm, the database on that participating cluster uses the new Redis version and CRDB protocol version.
-
After the database is upgraded on all participating clusters, check the status of the Active-Active database. If the status indicates
OLD CRDB FEATURESET VERSION, upgrade the feature set version. -
If your Active-Active database uses modules, update the module information in the Active-Active database configuration.
To check whether your database uses modules, run
rladmin status modules:rladmin status modules db { db:<ID> | <database-name> }To update the module information, run
crdb-cli crdb update:crdb-cli crdb update --crdb-guid <CRDB-GUID> --update-db-config-modules truecrdb-cliasks you to verify that the database and its modules are upgraded on all participating clusters. Enteryto continue:Verify that all CRDB database instances and their modules have been updated. Do you wish to proceed? [y/N]: y
--update-db-config-modules updates only the default configuration (default_db_config). Module versions pinned in each participating cluster's configuration (instances[].db_config) stay unchanged, but the command still reports success. These outdated versions can cause a later request to add or remove a participating cluster to fail, or to create the new participating cluster with outdated modules. If a participating cluster's configuration still lists outdated module versions after the upgrade, contact Redis support for help updating them.
Check database status
To check the status of the Active-Active database on a participating cluster, run rladmin status on a node of that cluster:
rladmin status
The statuses of the Active-Active database on the cluster can indicate:
-
OLD REDIS VERSION: The database is running a Redis version that is outdated or not fully compatible with the current Redis Software cluster version. Upgrade the Active-Active database to a later version of Redis bundled with the cluster's current Redis Software version. Use a coordinated upgrade or a manual upgrade. -
OLD CRDB PROTOCOL VERSION: The database uses an older CRDB protocol. The upgrade updates the CRDB protocol version unless you use the--keep-crdt-protocol-versionoption (keep_crdt_protocol_versionin the REST API). See CRDB protocol version guidelines for more information. -
OLD CRDB FEATURESET VERSION: The database feature set version is outdated. A coordinated upgrade updates the feature set version after the database is upgraded on all participating clusters, unless you use the--keep-crdt-featureset-versionoption (keep_crdt_featureset_versionin the REST API). After a manual upgrade, upgrade the feature set version yourself. See Feature set version guidelines for more information.
CRDB protocol version guidelines
The CRDB protocol version determines how the database on each participating cluster replicates write operations to the others. By default, a coordinated upgrade updates the CRDB protocol version on all participating clusters. A manual upgrade asks you to confirm the update on each participating cluster.
If you use the keep_crdt_protocol_version option, the database is upgraded without updating the CRDB protocol version. In this case:
-
You must upgrade the CRDB protocol version before the CRDB feature set version can be updated.
-
Upgrade the CRDB protocol version soon after with another coordinated upgrade request or
rladmin upgrade dbcommand without thekeep_crdt_protocol_versionoption.
Feature set version guidelines
Starting with Redis Software version 5.6.0, the feature set version helps support new Active-Active database features.
The feature set version is an internal version of the Active-Active database that enables new capabilities and improvements across participating clusters. When the feature set version is updated, it is updated for the database on all participating clusters.
By default, a coordinated upgrade updates the feature set version after the database is upgraded on all participating clusters. If you use the keep_crdt_featureset_version option, the upgrade keeps the current feature set version.
Follow these upgrade guidelines:
-
As of Redis Software version 6.0.20, feature set version 0 is deprecated and support will be removed in a future version.
-
To avoid upgrade failures, make sure all your Active-Active databases are configured with the latest feature set version before upgrading to Redis Software 6.0.20 or later.
Upgrade feature set version
If the feature set version is old, as indicated by the OLD CRDB FEATURESET VERSION status:
-
Upgrade the database on all participating clusters with a coordinated upgrade or a manual upgrade, and make sure the CRDB protocol version is not outdated.
-
Find the
<CRDB-GUID>of your Active-Active database.You can use the
crdb-cli crdb listcommand:crdb-cli crdb listLook for the fully qualified domain name (
CLUSTER-FQDN) of your cluster and use the associatedGUID:CRDB-GUID NAME REPL-ID CLUSTER-FQDN 700140c5-478e-49d7-ad3c-64d517ddc486 aatest 1 aatest1.example.com 700140c5-478e-49d7-ad3c-64d517ddc486 aatest 2 aatest2.example.com -
Update the feature set version of the Active-Active database. See Feature set version guidelines for more information.
crdb-cli crdb update --crdb-guid <CRDB-GUID> --featureset-version yes
Upgrade limitations
-
When upgrading an Active-Active database from Redis 7.4 or earlier to version 8.0 or later, if you add a module to the database during the upgrade, you cannot use that module's commands, such as Redis Search and JSON commands, until the database has been upgraded on all participating clusters. These commands are not blocked automatically, and running these commands before finishing the upgrade process can cause syncer crashes.
This limitation applies only when you add modules to a database during the upgrade. If the database already had modules configured before the upgrade, this limitation does not apply.