Skip to content

Commit eafa471

Browse files
Add page for updated PCR upgrade info (#20729)
* Added pcr upgrade page Added new page on the upgrade process with pcr enabled, including more detailed and accurate info than we had previously * summary length Fixed summary to be the right length * Quick changes from review A few small adjustments based on tech review * More changes from review Removed cloud only components and adjusting steps to match source of truth doc * More changes from review Some rewordings * Back/forward port Ported to 24.3, 25.2, 25.4 * Removed broken links Removed broken links * Updated language updated pages to have standardized 'system VC' 'app VC' 'reader VC' language * Docs review changes Changes from docs review- still need to add code snippets * Added code snippets Added code snippets to entire upgrade process * Fixed terminology Two instances of readervc didn't get changed * Final small changes Added some links * Broken link whoops broken link
1 parent 285f444 commit eafa471

18 files changed

+630
-58
lines changed

src/current/_includes/v24.3/sidebar-data/cross-cluster-replication.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@
4646
"/${VERSION}/set-up-physical-cluster-replication.html"
4747
]
4848
},
49+
{
50+
"title": "Upgrade a Cluster Running PCR",
51+
"urls": [
52+
"/${VERSION}/upgrade-with-pcr.html"
53+
]
54+
},
4955
{
5056
"title": "Fail Over from a Primary to a Standby Cluster",
5157
"urls": [

src/current/_includes/v25.2/sidebar-data/cross-cluster-replication.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@
4646
"/${VERSION}/set-up-physical-cluster-replication.html"
4747
]
4848
},
49+
{
50+
"title": "Upgrade a Cluster Running PCR",
51+
"urls": [
52+
"/${VERSION}/upgrade-with-pcr.html"
53+
]
54+
},
4955
{
5056
"title": "Fail Over from a Primary to a Standby Cluster",
5157
"urls": [

src/current/_includes/v25.3/sidebar-data/cross-cluster-replication.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@
4646
"/${VERSION}/set-up-physical-cluster-replication.html"
4747
]
4848
},
49+
{
50+
"title": "Upgrade a Cluster Running PCR",
51+
"urls": [
52+
"/${VERSION}/upgrade-with-pcr.html"
53+
]
54+
},
4955
{
5056
"title": "Fail Over from a Primary to a Standby Cluster",
5157
"urls": [

src/current/_includes/v25.4/sidebar-data/cross-cluster-replication.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@
4646
"/${VERSION}/set-up-physical-cluster-replication.html"
4747
]
4848
},
49+
{
50+
"title": "Upgrade a Cluster Running PCR",
51+
"urls": [
52+
"/${VERSION}/upgrade-with-pcr.html"
53+
]
54+
},
4955
{
5056
"title": "Fail Over from a Primary to a Standby Cluster",
5157
"urls": [

src/current/v24.3/physical-cluster-replication-overview.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,9 @@ Statement | Action
7171

7272
## Cluster versions and upgrades
7373

74-
{{site.data.alerts.callout_info}}
75-
The entire standby cluster must be at the same version as, or one version ahead of, the primary's virtual cluster.
76-
{{site.data.alerts.end}}
77-
78-
When PCR is enabled, upgrade with the following procedure. This upgrades the standby cluster before the primary cluster. Within the primary and standby CockroachDB clusters, the system virtual cluster must be at a cluster version greater than or equal to the virtual cluster:
74+
To safely perform a major version upgrade on a cluster with PCR, you must upgrade the standby cluster before the primary cluster to avoid version incompatibility. If you are using a reader virtual cluster (reader VC), you must upgrade it separately from the primary and standby clusters.
7975

80-
1. [Upgrade the binaries]({% link {{ page.version.version }}/upgrade-cockroach-version.md %}#perform-a-major-version-upgrade) on the primary and standby clusters. Replace the binary on each node of the cluster and restart the node.
81-
1. [Finalize]({% link {{ page.version.version }}/upgrade-cockroach-version.md %}#finalize-a-major-version-upgrade-manually) the upgrade on the standby's system virtual cluster if auto-finalization is disabled.
82-
1. [Finalize]({% link {{ page.version.version }}/upgrade-cockroach-version.md %}#finalize-a-major-version-upgrade-manually) the upgrade on the primary's system virtual cluster if auto-finalization is disabled.
83-
1. [Finalize]({% link {{ page.version.version }}/upgrade-cockroach-version.md %}#finalize-a-major-version-upgrade-manually) the upgrade on the standby's virtual cluster.
84-
1. [Finalize]({% link {{ page.version.version }}/upgrade-cockroach-version.md %}#finalize-a-major-version-upgrade-manually) the upgrade on the primary's virtual cluster.
76+
Follow the process described in [Upgrade a Cluster Running PCR]({% link {{ page.version.version }}/upgrade-with-pcr.md %}).
8577

8678
## Demo video
8779

src/current/v24.3/upgrade-cockroach-version.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ toc: true
55
docs_area: manage
66
---
77

8-
This page describes how major-version and patch upgrades work and shows how to upgrade a self-hosted CockroachDB. To upgrade a cluster in CockroachDB {{ site.data.products.cloud }}, refer to [Upgrade a cluster in CockroachDB {{ site.data.products.cloud }}]({% link cockroachcloud/upgrade-cockroach-version.md %}) instead.
8+
This page describes how major-version and patch upgrades work and shows how to upgrade a self-hosted CockroachDB.
9+
10+
To upgrade a cluster in CockroachDB {{ site.data.products.cloud }}, refer to [Upgrade a cluster in CockroachDB {{ site.data.products.cloud }}]({% link cockroachcloud/upgrade-cockroach-version.md %}) instead.
11+
12+
To upgrade a cluster with with [physical cluster replication (PCR)]({% link {{ page.version.version }}/physical-cluster-replication-overview.md %}), refer to [Upgrade a Cluster Running PCR]({% link {{ page.version.version }}/upgrade-with-pcr.md %}).
913

1014
## Overview
1115

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
---
2+
title: Upgrade a Cluster Running PCR
3+
summary: Upgrade your primary and standby clusters when using PCR.
4+
toc: true
5+
docs_area: manage
6+
---
7+
8+
To safely perform a major version upgrade on a cluster with [**physical cluster replication (PCR)**]({% link {{ page.version.version }}/physical-cluster-replication-overview.md %}), 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.
9+
10+
This page describes the process for safely performing a major version upgrade on a pair of clusters that have PCR enabled.
11+
12+
{{site.data.alerts.callout_info}}
13+
The entire standby cluster must be on the same major version as the primary cluster or a major version the primary cluster [can directly upgrade to]({% link {{ page.version.version }}/upgrade-cockroach-version.md %}#compatible-versions). 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)_.
14+
{{site.data.alerts.end}}
15+
16+
## Minor version upgrades
17+
18+
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 [patch upgrade process]({% link {{ page.version.version }}/upgrade-cockroach-version.md %}#perform-a-patch-upgrade).
19+
20+
## Upgrade primary and standby clusters
21+
22+
To upgrade your primary and standby clusters:
23+
24+
1. Ensure that the virtual clusters on both your primary cluster and your standby cluster are [finalized]({% link {{ page.version.version }}/upgrade-cockroach-version.md %}#finalize-a-major-version-upgrade-manually) on the current version before beginning the upgrade process.
25+
26+
1. [Upgrade the binaries]({% link {{ page.version.version }}/upgrade-cockroach-version.md %}#perform-a-major-version-upgrade) on the standby cluster. On each node of the cluster, replace the binary and restart the node.
27+
28+
1. [Connect]({% link {{ page.version.version }}/work-with-virtual-clusters.md %}#connect-to-the-system-virtual-cluster) to the standby cluster's system VC:
29+
30+
{% include_cached copy-clipboard.html %}
31+
~~~ shell
32+
cockroach sql --url \
33+
"postgresql://root@{standby node IP or hostname}:26257?options=-ccluster=system&sslmode=verify-full" \
34+
--certs-dir "certs"
35+
~~~
36+
37+
1. [Finalize]({% link {{ page.version.version }}/upgrade-cockroach-version.md %}#finalize-a-major-version-upgrade-manually) the upgrade on the standby cluster's system VC:
38+
39+
{% include_cached copy-clipboard.html %}
40+
~~~ sql
41+
SET CLUSTER SETTING version '{VERSION}';
42+
~~~
43+
44+
{{site.data.alerts.callout_info}}
45+
If you need to [roll back]({% link {{ page.version.version }}/upgrade-cockroach-version.md %}#roll-back-a-major-version-upgrade) an upgrade, you must do so before the upgrade has been finalized.
46+
{{site.data.alerts.end}}
47+
48+
1. Confirm that finalization is complete on the standby cluster's system VC:
49+
50+
{% include_cached copy-clipboard.html %}
51+
~~~ sql
52+
> SHOW CLUSTER SETTING version;
53+
~~~
54+
55+
1. [Upgrade the binaries]({% link {{ page.version.version }}/upgrade-cockroach-version.md %}#perform-a-major-version-upgrade) on the primary cluster. On each node of the cluster, replace the binary and restart the node.
56+
57+
1. [Connect]({% link {{ page.version.version }}/work-with-virtual-clusters.md %}#connect-to-the-system-virtual-cluster) to the primary cluster's system VC:
58+
59+
{% include_cached copy-clipboard.html %}
60+
~~~ shell
61+
cockroach sql --url \
62+
"postgresql://root@{primary node IP or hostname}:26257?options=-ccluster=system&sslmode=verify-full" \
63+
--certs-dir "certs"
64+
~~~
65+
66+
1. [Finalize]({% link {{ page.version.version }}/upgrade-cockroach-version.md %}#finalize-a-major-version-upgrade-manually) the upgrade on the primary cluster's system VC:
67+
68+
{% include_cached copy-clipboard.html %}
69+
~~~ sql
70+
SET CLUSTER SETTING version '{VERSION}';
71+
~~~
72+
73+
{{site.data.alerts.callout_info}}
74+
If you need to [roll back]({% link {{ page.version.version }}/upgrade-cockroach-version.md %}#roll-back-a-major-version-upgrade) 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.
75+
{{site.data.alerts.end}}
76+
77+
1. Confirm that finalization is complete on the primary cluster's system VC:
78+
79+
{% include_cached copy-clipboard.html %}
80+
~~~ sql
81+
> SHOW CLUSTER SETTING version;
82+
~~~
83+
84+
1. [Connect]({% link {{ page.version.version }}/work-with-virtual-clusters.md %}#connect-to-the-system-virtual-cluster) to the primary cluster's app VC:
85+
86+
{% include_cached copy-clipboard.html %}
87+
~~~ shell
88+
cockroach sql --url \
89+
"postgresql://root@{primary node IP or hostname}:26257?options=-ccluster={app_virtual_cluster_name}&sslmode=verify-full" \
90+
--certs-dir "certs"
91+
~~~
92+
93+
1. [Finalize]({% link {{ page.version.version }}/upgrade-cockroach-version.md %}#finalize-a-major-version-upgrade-manually) the upgrade on the primary cluster's app VC:
94+
95+
{% include_cached copy-clipboard.html %}
96+
~~~ sql
97+
SET CLUSTER SETTING version '{VERSION}';
98+
~~~
99+
100+
Upgrading the primary cluster's app VC also upgrades the standby cluster's app VC, since it replicates from the primary.
101+
102+
1. Confirm that finalization is complete on the primary cluster's app VC:
103+
104+
{% include_cached copy-clipboard.html %}
105+
~~~ sql
106+
> SHOW CLUSTER SETTING version;
107+
~~~
108+
109+
## Upgrade reader VC
110+
111+
If you have a _reader virtual cluster (reader VC)_, 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:
112+
113+
1. After upgrading the app VC on your primary cluster, wait for the replicated time to pass the time at which the upgrade completed.
114+
1. On the standby cluster, stop the reader VC service:
115+
116+
{% include_cached copy-clipboard.html %}
117+
~~~ sql
118+
ALTER VIRTUAL CLUSTER <readervc-name> STOP SERVICE;
119+
~~~
120+
121+
1. Drop the reader VC:
122+
123+
{% include_cached copy-clipboard.html %}
124+
~~~ sql
125+
DROP VIRTUAL CLUSTER <readervc-name>;
126+
~~~
127+
128+
1. On the standby cluster, re-create the reader VC:
129+
130+
{% include_cached copy-clipboard.html %}
131+
~~~ sql
132+
ALTER VIRTUAL CLUSTER dest-system SET REPLICATION READ VIRTUAL CLUSTER;
133+
~~~
134+
135+
At this point, the reader VC is on the same version as the standby cluster.
136+
137+
## Failover and fast failback during upgrade
138+
139+
If needed, you can perform a [failover]({% link {{ page.version.version }}/failover-replication.md %}) while upgrading your clusters.
140+
141+
However, after performing a failover you cannot perform a [fast failback]({% link {{ page.version.version }}/failover-replication.md %}#failback) 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.

src/current/v25.2/physical-cluster-replication-overview.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,9 @@ Statement | Action
6969

7070
## Cluster versions and upgrades
7171

72-
{{site.data.alerts.callout_info}}
73-
The entire standby cluster must be at the same version as, or one version ahead of, the primary's virtual cluster.
74-
{{site.data.alerts.end}}
75-
76-
When PCR is enabled, upgrade with the following procedure. This upgrades the standby cluster before the primary cluster. Within the primary and standby CockroachDB clusters, the system virtual cluster must be at a cluster version greater than or equal to the virtual cluster:
72+
To safely perform a major version upgrade on a cluster with PCR, you must upgrade the standby cluster before the primary cluster to avoid version incompatibility. If you are using a reader virtual cluster (reader VC), you must upgrade it separately from the primary and standby clusters.
7773

78-
1. [Upgrade the binaries]({% link {{ page.version.version }}/upgrade-cockroach-version.md %}#perform-a-major-version-upgrade) on the primary and standby clusters. Replace the binary on each node of the cluster and restart the node.
79-
1. [Finalize]({% link {{ page.version.version }}/upgrade-cockroach-version.md %}#finalize-a-major-version-upgrade-manually) the upgrade on the standby's system virtual cluster if auto-finalization is disabled.
80-
1. [Finalize]({% link {{ page.version.version }}/upgrade-cockroach-version.md %}#finalize-a-major-version-upgrade-manually) the upgrade on the primary's system virtual cluster if auto-finalization is disabled.
81-
1. [Finalize]({% link {{ page.version.version }}/upgrade-cockroach-version.md %}#finalize-a-major-version-upgrade-manually) the upgrade on the standby's virtual cluster.
82-
1. [Finalize]({% link {{ page.version.version }}/upgrade-cockroach-version.md %}#finalize-a-major-version-upgrade-manually) the upgrade on the primary's virtual cluster.
74+
Follow the process described in [Upgrade a Cluster Running PCR]({% link {{ page.version.version }}/upgrade-with-pcr.md %}).
8375

8476
## Demo video
8577

src/current/v25.2/upgrade-cockroach-version.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ toc: true
55
docs_area: manage
66
---
77

8-
This page describes how major-version and patch upgrades work and shows how to upgrade a self-hosted CockroachDB. To upgrade a cluster in CockroachDB {{ site.data.products.cloud }}, refer to [Upgrade a cluster in CockroachDB {{ site.data.products.cloud }}]({% link cockroachcloud/upgrade-cockroach-version.md %}) instead.
8+
This page describes how major-version and patch upgrades work and shows how to upgrade a self-hosted CockroachDB.
9+
10+
To upgrade a cluster in CockroachDB {{ site.data.products.cloud }}, refer to [Upgrade a cluster in CockroachDB {{ site.data.products.cloud }}]({% link cockroachcloud/upgrade-cockroach-version.md %}) instead.
11+
12+
To upgrade a cluster with with [physical cluster replication (PCR)]({% link {{ page.version.version }}/physical-cluster-replication-overview.md %}), refer to [Upgrade a Cluster Running PCR]({% link {{ page.version.version }}/upgrade-with-pcr.md %}).
913

1014
## Overview
1115

0 commit comments

Comments
 (0)