Skip to main content
To safely perform a major version upgrade on a cluster with , you must upgrade the standby cluster before the primary cluster to avoid version incompatibility. You cannot replicate data from a cluster on a newer version to a cluster on an older version. This page describes the process for safely performing a major version upgrade on a pair of clusters that have PCR enabled.
The entire standby cluster must be on the same major version as the primary cluster or a major version the primary cluster . Within the primary and standby CockroachDB clusters, the system virtual cluster (system VC) must be at a cluster major version greater than or equal to the application virtual cluster (app VC).

Minor version upgrades

Minor versions are not relevant when determining PCR compatibility. There is no need to consider PCR compatibility when upgrading to a specific minor version within a major version, so you can follow the normal .

Upgrade primary and standby clusters

To upgrade your primary and standby clusters:
  1. Ensure that the virtual clusters on both your primary cluster and your standby cluster are on the current version before beginning the upgrade process.
  2. on the standby cluster. On each node of the cluster, replace the binary and restart the node.
  3. to the standby cluster’s system VC:
  4. the upgrade on the standby cluster’s system VC:
If you need to an upgrade, you must do so before the upgrade has been finalized.
  1. Confirm that finalization is complete on the standby cluster’s system VC:
  2. on the primary cluster. On each node of the cluster, replace the binary and restart the node.
  3. to the primary cluster’s system VC:
  4. the upgrade on the primary cluster’s system VC:
If you need to an upgrade, you must do so before the upgrade has been finalized. Rolling back the upgrade on the primary cluster does not roll back the standby cluster.
  1. Confirm that finalization is complete on the primary cluster’s system VC:
  2. to the primary cluster’s app VC:
  3. the upgrade on the primary cluster’s app VC:
    Upgrading the primary cluster’s app VC also upgrades the standby cluster’s app VC, since it replicates from the primary.
  4. Confirm that finalization is complete on the primary cluster’s app VC:

Upgrade reader VC

If you have a , you must drop and recreate it to upgrade after completing the main upgrade process on the primary and standby clusters. Follow these steps to upgrade your reader VC:
  1. After upgrading the app VC on your primary cluster, wait for the replicated time to pass the time at which the upgrade completed.
  2. On the standby cluster, stop the reader VC service:
  3. Drop the reader VC:
  4. On the standby cluster, re-create the reader VC:
At this point, the reader VC is on the same version as the standby cluster.

Failover and fast failback during upgrade

If needed, you can perform a while upgrading your clusters. However, after performing a failover you cannot perform a to the original primary cluster while the standby cluster version is newer than the primary cluster version. This is because you cannot replicate data from a cluster on a newer version to a cluster on an older version.