Skip to content

Commit

Permalink
sql: allow ALTER DATABASE PRIMARY REGION to work on system tenants
Browse files Browse the repository at this point in the history
Previously, on a multi-region setup the system database could not be modified to be multi-region and it was blocked from being made multi-region aware. To address this, we are now allowing ALTER DATABASE
PRIMARY REGION to work on system tenants.

Fixes: #63365
Epic: CRDB-33032

Release note (sql change): Previously, we added support for settings reegion on the system database, which was limited to tenants only. We lifted this limitation to allow ALTER DATABASE PRIMARY REGION to work on system tenants.
To support preview status, we created a cluster setting called sql.multiregion.preview_multiregion_system_database that will give users the option to set up their system database as multi-region for Cockroach dedicated
(this cluster setting is not enabled by default). Note that after adding non-primary regions, we recommend that users do a rolling restart to propogate region information.
  • Loading branch information
jasminejsun committed Apr 8, 2024
1 parent 49173f4 commit 6f3cae0
Show file tree
Hide file tree
Showing 7 changed files with 384 additions and 175 deletions.
2 changes: 1 addition & 1 deletion pkg/ccl/logictestccl/testdata/logic_test/multi_region
Expand Up @@ -544,7 +544,7 @@ ALTER DATABASE system PRIMARY REGION "ap-southeast-2"
# are in the system tenant. Hence the lack of error code checking and the
# regex matching both possible outcomes.
skipif config multiregion-9node-3region-3azs-tenant
statement error user testuser may not modify the system database|modifying the regions of system database is not supported
statement error user testuser may not modify the system database|Modifying the regions of system database is not supported. Set up your system database as multi-region using the cluster setting `sql.multiregion.preview_multiregion_system_database.enabled` https://www.cockroachlabs.com/docs/stable/cluster-settings
ALTER DATABASE system PRIMARY REGION "ap-southeast-2"

user root
Expand Down

0 comments on commit 6f3cae0

Please sign in to comment.