-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql: allow ALTER DATABASE PRIMARY REGION to work on system tenants #121293
Conversation
6de1305
to
9002107
Compare
9002107
to
771e97b
Compare
5463cae
to
ef0fde6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 6 files at r1, 1 of 1 files at r2, 3 of 3 files at r3, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @annrpom and @jasminejsun)
pkg/cmd/roachtest/tests/multi_region_system_database.go
line 117 at r3 (raw file):
t.WorkerStatus("stop") stopOpts := option.DefaultStopOpts() c.Stop(ctx, t.L(), stopOpts, c.Node(i))
I think this does a graceful kill, lets be a bit more aggressive:
c.Run(ctx, install.WithNodes(c.Node(i), "killall -9 cockroach")
pkg/ccl/multiregionccl/multiregion_system_table_test.go
line 310 at r3 (raw file):
} func TestMRSystemDatabase(t *testing.T) {
I'm thinking we just modify the multi-tenant multi-region one above to also test the system tenant. What do you think?
3fa7ec1
to
cd7939e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r4.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @annrpom and @jasminejsun)
pkg/ccl/multiregionccl/multiregion_system_table_test.go
line 84 at r4 (raw file):
tDB.CheckQueryResults(t, `SELECT * FROM crdb_internal.invalid_objects`, [][]string{}) _, err = sqlDB.Exec(`SET CLUSTER SETTING sql.multiregion.preview_multiregion_system_database.enabled = true`)
Okay perfect, now lets just modify the tests below to check with both tDB and sqlDB. We can use a loop to pick one of the databases and confirm the same properties hold.
cd7939e
to
22484cb
Compare
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: cockroachdb#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.
22484cb
to
6f3cae0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r5, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @jasminejsun)
pkg/ccl/multiregionccl/multiregion_system_table_test.go
line 91 at r5 (raw file):
sDB.Exec(t, `ALTER DATABASE system ADD REGION "us-east3"`) testCases := []struct {
Nice!
bors r+ |
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. Note that after adding non-primary regions, we recommend that users do a rolling restart to propogate region information.