-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: Primary Region can be set to the Secondary Region #86879
Copy link
Copy link
Closed
Labels
C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.GA-blockerbranch-masterFailures and bugs on the master branch.Failures and bugs on the master branch.
Description
We noticed that the primary region can be assigned the same value as the secondary region.
Right now this doesn’t cause any issues since there is a case where partition primary regions can match a secondary region.
To Reproduce
demo@127.0.0.1:26257/movr> CREATE DATABASE db PRIMARY REGION "us-east1" REGIONS "us-west1" SECONDARY REGION "us-west1";
CREATE DATABASE
demo@127.0.0.1:26257/movr> ALTER DATABASE db SET SECONDARY REGION "us-east1";
ERROR: the secondary region cannot be the same as the current primary region
SQLSTATE: 42P12
demo@127.0.0.1:26257/movr> ALTER DATABASE db SET PRIMARY REGION "us-west1";
ALTER DATABASE PRIMARY REGION
We can block this behavior, or drop the secondary region and send a notice.
Epic CRDB-2521
Jira issue: CRDB-18980
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.GA-blockerbranch-masterFailures and bugs on the master branch.Failures and bugs on the master branch.