Skip to content

Add zone config troubleshooting guide #19283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
During a [cluster restore]({% link {{ page.version.version }}/restore.md %}#full-cluster), any [zone configurations]({% link {{ page.version.version }}/configure-replication-zones.md %}) present on the destination cluster are **overwritten** with the zone configurations from the [backed-up cluster]({% link {{ page.version.version }}/backup.md %}#back-up-a-cluster). If no customized zone configurations were on the cluster when the backup was taken, then after the restore the destination cluster will use the zone configuration from the [`RANGE DEFAULT` configuration]({% link {{ page.version.version }}/configure-replication-zones.md %}#view-the-default-replication-zone).
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
For instructions showing how to troubleshoot replication zones that may be misconfigured, see [Troubleshoot Replication Zone Configurations]({% link {{ page.version.version}}/troubleshoot-replication-zones.md %}).
6 changes: 6 additions & 0 deletions src/current/_includes/v23.1/sidebar-data/troubleshooting.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@
"/${VERSION}/query-replication-reports.html"
]
},
{
"title": "Troubleshoot Replication Zones",
"urls": [
"/${VERSION}/troubleshoot-replication-zones.html"
]
},
{
"title": "Benchmarking",
"items": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Cockroach Labs {% if page.name != "configure-replication-zones.md" %} [does not recommend modifying zone configurations manually]({% link {{ page.version.version }}/configure-replication-zones.md %}#why-manual-zone-config-management-is-not-recommended). {% else %} [does not recommend modifying zone configurations manually](#why-manual-zone-config-management-is-not-recommended). {% endif %}

Most users should use [multi-region SQL statements]({% link {{ page.version.version }}/multiregion-overview.md %}) instead. If additional control is needed, use [Zone Config Extensions]({% link {{ page.version.version }}/zone-config-extensions.md %}) to augment the multi-region SQL statements.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
During a [cluster restore]({% link {{ page.version.version }}/restore.md %}#full-cluster), any [zone configurations]({% link {{ page.version.version }}/configure-replication-zones.md %}) present on the destination cluster are **overwritten** with the zone configurations from the [backed-up cluster]({% link {{ page.version.version }}/backup.md %}#back-up-a-cluster). If no customized zone configurations were on the cluster when the backup was taken, then after the restore the destination cluster will use the zone configuration from the [`RANGE DEFAULT` configuration]({% link {{ page.version.version }}/configure-replication-zones.md %}#view-the-default-replication-zone).
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
For instructions showing how to troubleshoot replication zones that may be misconfigured, see [Troubleshoot Replication Zone Configurations]({% link {{ page.version.version}}/troubleshoot-replication-zones.md %}).
6 changes: 6 additions & 0 deletions src/current/_includes/v23.2/sidebar-data/troubleshooting.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@
"/${VERSION}/query-replication-reports.html"
]
},
{
"title": "Troubleshoot Replication Zones",
"urls": [
"/${VERSION}/troubleshoot-replication-zones.html"
]
},
{
"title": "Benchmarking",
"items": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Cockroach Labs {% if page.name != "configure-replication-zones.md" %} [does not recommend modifying zone configurations manually]({% link {{ page.version.version }}/configure-replication-zones.md %}#why-manual-zone-config-management-is-not-recommended). {% else %} [does not recommend modifying zone configurations manually](#why-manual-zone-config-management-is-not-recommended). {% endif %}

Most users should use [multi-region SQL statements]({% link {{ page.version.version }}/multiregion-overview.md %}) instead. If additional control is needed, use [Zone Config Extensions]({% link {{ page.version.version }}/zone-config-extensions.md %}) to augment the multi-region SQL statements.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
During a [cluster restore]({% link {{ page.version.version }}/restore.md %}#full-cluster), any [zone configurations]({% link {{ page.version.version }}/configure-replication-zones.md %}) present on the destination cluster are **overwritten** with the zone configurations from the [backed-up cluster]({% link {{ page.version.version }}/backup.md %}#back-up-a-cluster). If no customized zone configurations were on the cluster when the backup was taken, then after the restore the destination cluster will use the zone configuration from the [`RANGE DEFAULT` configuration]({% link {{ page.version.version }}/configure-replication-zones.md %}#view-the-default-replication-zone).
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
For instructions showing how to troubleshoot replication zones that may be misconfigured, see [Troubleshoot Replication Zone Configurations]({% link {{ page.version.version}}/troubleshoot-replication-zones.md %}).
6 changes: 6 additions & 0 deletions src/current/_includes/v24.1/sidebar-data/troubleshooting.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@
"/${VERSION}/query-replication-reports.html"
]
},
{
"title": "Troubleshoot Replication Zones",
"urls": [
"/${VERSION}/troubleshoot-replication-zones.html"
]
},
{
"title": "Benchmarking",
"items": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Cockroach Labs {% if page.name != "configure-replication-zones.md" %} [does not recommend modifying zone configurations manually]({% link {{ page.version.version }}/configure-replication-zones.md %}#why-manual-zone-config-management-is-not-recommended). {% else %} [does not recommend modifying zone configurations manually](#why-manual-zone-config-management-is-not-recommended). {% endif %}

Most users should use [multi-region SQL statements]({% link {{ page.version.version }}/multiregion-overview.md %}) instead. If additional control is needed, use [Zone Config Extensions]({% link {{ page.version.version }}/zone-config-extensions.md %}) to augment the multi-region SQL statements.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
During a [cluster restore]({% link {{ page.version.version }}/restore.md %}#full-cluster), any [zone configurations]({% link {{ page.version.version }}/configure-replication-zones.md %}) present on the destination cluster are **overwritten** with the zone configurations from the [backed-up cluster]({% link {{ page.version.version }}/backup.md %}#back-up-a-cluster). If no customized zone configurations were on the cluster when the backup was taken, then after the restore the destination cluster will use the zone configuration from the [`RANGE DEFAULT` configuration]({% link {{ page.version.version }}/configure-replication-zones.md %}#view-the-default-replication-zone).
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
For instructions showing how to troubleshoot replication zones that may be misconfigured, see [Troubleshoot Replication Zone Configurations]({% link {{ page.version.version}}/troubleshoot-replication-zones.md %}).
6 changes: 6 additions & 0 deletions src/current/_includes/v24.2/sidebar-data/troubleshooting.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@
"/${VERSION}/query-replication-reports.html"
]
},
{
"title": "Troubleshoot Replication Zones",
"urls": [
"/${VERSION}/troubleshoot-replication-zones.html"
]
},
{
"title": "Benchmarking",
"items": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Cockroach Labs {% if page.name != "configure-replication-zones.md" %} [does not recommend modifying zone configurations manually]({% link {{ page.version.version }}/configure-replication-zones.md %}#why-manual-zone-config-management-is-not-recommended). {% else %} [does not recommend modifying zone configurations manually](#why-manual-zone-config-management-is-not-recommended). {% endif %}

Most users should use [multi-region SQL statements]({% link {{ page.version.version }}/multiregion-overview.md %}) instead. If additional control is needed, use [Zone Config Extensions]({% link {{ page.version.version }}/zone-config-extensions.md %}) to augment the multi-region SQL statements.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
During a [cluster restore]({% link {{ page.version.version }}/restore.md %}#full-cluster), any [zone configurations]({% link {{ page.version.version }}/configure-replication-zones.md %}) present on the destination cluster are **overwritten** with the zone configurations from the [backed-up cluster]({% link {{ page.version.version }}/backup.md %}#back-up-a-cluster). If no customized zone configurations were on the cluster when the backup was taken, then after the restore the destination cluster will use the zone configuration from the [`RANGE DEFAULT` configuration]({% link {{ page.version.version }}/configure-replication-zones.md %}#view-the-default-replication-zone).
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
For instructions showing how to troubleshoot replication zones that may be misconfigured, see [Troubleshoot Replication Zone Configurations]({% link {{ page.version.version}}/troubleshoot-replication-zones.md %}).
6 changes: 6 additions & 0 deletions src/current/_includes/v24.3/sidebar-data/troubleshooting.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@
"/${VERSION}/query-replication-reports.html"
]
},
{
"title": "Troubleshoot Replication Zones",
"urls": [
"/${VERSION}/troubleshoot-replication-zones.html"
]
},
{
"title": "Benchmarking",
"items": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Cockroach Labs {% if page.name != "configure-replication-zones.md" %} [does not recommend modifying zone configurations manually]({% link {{ page.version.version }}/configure-replication-zones.md %}#why-manual-zone-config-management-is-not-recommended). {% else %} [does not recommend modifying zone configurations manually](#why-manual-zone-config-management-is-not-recommended). {% endif %}

Most users should use [multi-region SQL statements]({% link {{ page.version.version }}/multiregion-overview.md %}) instead. If additional control is needed, use [Zone Config Extensions]({% link {{ page.version.version }}/zone-config-extensions.md %}) to augment the multi-region SQL statements.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
During a [cluster restore]({% link {{ page.version.version }}/restore.md %}#full-cluster), any [zone configurations]({% link {{ page.version.version }}/configure-replication-zones.md %}) present on the destination cluster are **overwritten** with the zone configurations from the [backed-up cluster]({% link {{ page.version.version }}/backup.md %}#back-up-a-cluster). If no customized zone configurations were on the cluster when the backup was taken, then after the restore the destination cluster will use the zone configuration from the [`RANGE DEFAULT` configuration]({% link {{ page.version.version }}/configure-replication-zones.md %}#view-the-default-replication-zone).
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
For instructions showing how to troubleshoot replication zones that may be misconfigured, see [Troubleshoot Replication Zone Configurations]({% link {{ page.version.version}}/troubleshoot-replication-zones.md %}).
6 changes: 6 additions & 0 deletions src/current/_includes/v25.1/sidebar-data/troubleshooting.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@
"/${VERSION}/query-replication-reports.html"
]
},
{
"title": "Troubleshoot Replication Zones",
"urls": [
"/${VERSION}/troubleshoot-replication-zones.html"
]
},
{
"title": "Benchmarking",
"items": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Cockroach Labs {% if page.name != "configure-replication-zones.md" %} [does not recommend modifying zone configurations manually]({% link {{ page.version.version }}/configure-replication-zones.md %}#why-manual-zone-config-management-is-not-recommended). {% else %} [does not recommend modifying zone configurations manually](#why-manual-zone-config-management-is-not-recommended). {% endif %}

Most users should use [multi-region SQL statements]({% link {{ page.version.version }}/multiregion-overview.md %}) instead. If additional control is needed, use [Zone Config Extensions]({% link {{ page.version.version }}/zone-config-extensions.md %}) to augment the multi-region SQL statements.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions src/current/v23.1/alter-database.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ For usage, see [Synopsis](#synopsis).
If you directly change a database's zone configuration with `ALTER DATABASE ... CONFIGURE ZONE`, CockroachDB will block all [`ALTER DATABASE ... SET PRIMARY REGION`](#set-primary-region) statements on the database.
{{site.data.alerts.end}}

{{site.data.alerts.callout_danger}}
{% include {{ page.version.version }}/zone-configs/avoid-manual-zone-configs.md %}
{{site.data.alerts.end}}

You can use *replication zones* to control the number and location of replicas for specific sets of data, both when replicas are first added and when they are rebalanced to maintain cluster equilibrium.

For examples, see [Replication Controls](#configure-replication-zones).
Expand Down Expand Up @@ -691,6 +695,10 @@ HINT: you must first drop super region usa before you can drop the region us-wes

### Configure replication zones

{{site.data.alerts.callout_danger}}
{% include {{ page.version.version }}/zone-configs/avoid-manual-zone-configs.md %}
{{site.data.alerts.end}}

{% include {{ page.version.version }}/sql/movr-statements-geo-partitioned-replicas.md %}

#### Create a replication zone for a database
Expand All @@ -717,6 +725,10 @@ You cannot `DISCARD` any zone configurations on multi-region tables, indexes, or
ALTER DATABASE movr CONFIGURE ZONE DISCARD;
~~~

### Troubleshoot replication zones

{% include {{ page.version.version }}/see-zone-config-troubleshooting-guide.md %}

### Use Zone Config Extensions

The following examples show:
Expand Down Expand Up @@ -1080,6 +1092,12 @@ When you discard a zone configuration, the objects it was applied to will then i
However, this statement will not remove any configuration created by the [multi-region abstractions]({% link {{ page.version.version }}/multiregion-overview.md %}).
{{site.data.alerts.end}}

#### Troubleshoot Zone Config Extensions

The process for troubleshooting Zone Config Extensions is the same as troubleshooting any other changes to zone configs.

{% include {{ page.version.version }}/see-zone-config-troubleshooting-guide.md %}

### Change database owner

{% include {{page.version.version}}/sql/movr-statements.md %}
Expand Down Expand Up @@ -1285,3 +1303,4 @@ For more information about the region survival goal, see [Surviving region failu
- [`ALTER TABLE`]({% link {{ page.version.version }}/alter-table.md %})
- [Online Schema Changes]({% link {{ page.version.version }}/online-schema-changes.md %})
- [SQL Statements]({% link {{ page.version.version }}/sql-statements.md %})
- [Troubleshoot Replication Zones]({% link {{ page.version.version}}/troubleshoot-replication-zones.md %})
8 changes: 6 additions & 2 deletions src/current/v23.1/alter-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ Subcommand | Description |

`ALTER INDEX ... CONFIGURE ZONE` is used to add, modify, reset, or remove replication zones for an index. To view details about existing replication zones, use [`SHOW ZONE CONFIGURATIONS`]({% link {{ page.version.version }}/show-zone-configurations.md %}). For more information about replication zones, see [Replication Controls]({% link {{ page.version.version }}/configure-replication-zones.md %}).



You can use *replication zones* to control the number and location of replicas for specific sets of data, both when replicas are first added and when they are rebalanced to maintain cluster equilibrium.

For examples, see [Replication Controls](#configure-replication-zones).

{% include {{ page.version.version }}/see-zone-config-troubleshooting-guide.md %}

#### Required privileges

The user must be a member of the [`admin` role]({% link {{ page.version.version }}/security-reference/authorization.md %}#admin-role) or have been granted [`CREATE`]({% link {{ page.version.version }}/security-reference/authorization.md %}#supported-privileges) or [`ZONECONFIG`]({% link {{ page.version.version }}/security-reference/authorization.md %}#supported-privileges) privileges. To configure [`system` objects]({% link {{ page.version.version }}/configure-replication-zones.md %}#for-system-data), the user must be a member of the `admin` role.
Expand Down Expand Up @@ -213,6 +213,10 @@ You cannot `DISCARD` any zone configurations on multi-region tables, indexes, or
ALTER INDEX vehicles@vehicles_auto_index_fk_city_ref_users CONFIGURE ZONE DISCARD;
~~~

#### Troubleshoot replication zones

{% include {{ page.version.version }}/see-zone-config-troubleshooting-guide.md %}

### Define partitions

#### Define a list partition on an index
Expand Down
10 changes: 10 additions & 0 deletions src/current/v23.1/alter-partition.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ docs_area: reference.sql

To view details about existing replication zones, use [`SHOW ZONE CONFIGURATIONS`]({% link {{ page.version.version }}/show-zone-configurations.md %}). For more information about replication zones, see [Replication Controls]({% link {{ page.version.version }}/configure-replication-zones.md %}).

{% include {{ page.version.version }}/see-zone-config-troubleshooting-guide.md %}

You can use *replication zones* to control the number and location of replicas for specific sets of data, both when replicas are first added and when they are rebalanced to maintain cluster equilibrium.


Expand Down Expand Up @@ -44,3 +46,11 @@ The user must have the [`CREATE`]({% link {{ page.version.version }}/grant.md %}
### Create a replication zone for a partition

{% include {{ page.version.version }}/zone-configs/create-a-replication-zone-for-a-table-partition.md hide-enterprise-warning="true" %}

{% include {{ page.version.version }}/see-zone-config-troubleshooting-guide.md %}

## See also

- [Table partitioning]({% link {{page.version.version}}/partitioning.md %})
- [`SHOW PARTITIONS`]({% link {{page.version.version}}/show-partitions.md %})
- [Troubleshoot Replication Zones]({% link {{ page.version.version}}/troubleshoot-replication-zones.md %})
Loading
Loading