sql: add cluster setting to gate PLACEMENT operations#69005
sql: add cluster setting to gate PLACEMENT operations#69005craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
7ce0d50 to
4be32a0
Compare
arulajmani
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @otan and @pawalt)
pkg/sql/create_database.go, line 100 at r1 (raw file):
if !p.EvalContext().SessionData.PlacementEnabled { return nil, pgerror.New( pgcode.InvalidDatabaseDefinition,
Feature not supported instead, maybe?
pkg/sql/create_database.go, line 101 at r1 (raw file):
return nil, pgerror.New( pgcode.InvalidDatabaseDefinition,
extra line?
pkg/sql/create_database.go, line 102 at r1 (raw file):
pgcode.InvalidDatabaseDefinition, "PLACEMENT requires that the cluster setting sql.defaults.experimental_placement "+
Should we be referencing the session setting here instead as the cluster setting only serves as a default?
Also, let's put the exact session setting that the user might need to change in the HINT message. It's nice to have these things copy-paste-able.
pkg/sql/exec_util.go, line 236 at r1 (raw file):
var placementEnabledClusterMode = settings.RegisterBoolSetting( "sql.defaults.experimental_placement.enabled",
Let's call this sql.defaults.multiregion_placement_policy.enabled?
Last I heard we were moving away from "experimental" in cluster settings/syntax etc.
pkg/sql/vars.go, line 1258 at r1 (raw file):
// CockroachDB extension. `experimental_enable_placement`: {
Same as above, instead of experimental_enable_placement, let's call this enable_multiregion_placement_policy instead.
pkg/sql/sessiondatapb/local_only_session_data.proto, line 170 at r1 (raw file):
// PlacementEnabled indicates whether PLACEMENT can be used or not. bool placement_enabled = 44;
Why do we need this?
7952fef to
77c6806
Compare
pawalt
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @arulajmani and @otan)
pkg/sql/create_database.go, line 100 at r1 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
Feature not supported instead, maybe?
Done.
pkg/sql/create_database.go, line 101 at r1 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
extra line?
Done.
pkg/sql/create_database.go, line 102 at r1 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
Should we be referencing the session setting here instead as the cluster setting only serves as a default?
Also, let's put the exact session setting that the user might need to change in the HINT message. It's nice to have these things copy-paste-able.
I'll put the session setting in the main error and cluster setting in the hint so they know where to go for long-term changes.
pkg/sql/exec_util.go, line 236 at r1 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
Let's call this
sql.defaults.multiregion_placement_policy.enabled?Last I heard we were moving away from "experimental" in cluster settings/syntax etc.
Done.
pkg/sql/vars.go, line 1258 at r1 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
Same as above, instead of
experimental_enable_placement, let's call thisenable_multiregion_placement_policyinstead.
Done.
pkg/sql/sessiondatapb/local_only_session_data.proto, line 170 at r1 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
Why do we need this?
@otan moved our session setting from an enum to proto, so we've gotta add this here.
arulajmani
left a comment
There was a problem hiding this comment.
once the commit message is updated
Reviewed 1 of 13 files at r1, 1 of 1 files at r2, 11 of 11 files at r3, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @otan and @pawalt)
-- commits, line 6 at r3 ([raw file](https://github.com/cockroachdb/cockroach/blob/77c6806264161af6dddd888948e3239d82748e82/-- commits#L6)):
I think your commit message needs an update with the new session/cluster settings in.
Also, add a nod to the fact that you're intentionally skipping on the release note here and why.
pkg/sql/create_database.go, line 102 at r1 (raw file):
Previously, pawalt (Peyton Walters) wrote…
I'll put the session setting in the main error and cluster setting in the hint so they know where to go for long-term changes.
Maybe I'm lazy, but I really like when I can just copy paste the exact session setting I need to change instead of deciphering a hint message. Maybe something like "you can enable multi-region placement policy by running SET enable_multiregion_placement_policy = true in the hint.
Your call!
pkg/sql/sessiondatapb/local_only_session_data.proto, line 170 at r1 (raw file):
Previously, pawalt (Peyton Walters) wrote…
@otan moved our session setting from an enum to proto, so we've gotta add this here.
TIL!
77c6806 to
f7c144b
Compare
pawalt
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @arulajmani and @otan)
-- commits, line 6 at r3 ([raw file](https://github.com/cockroachdb/cockroach/blob/77c6806264161af6dddd888948e3239d82748e82/-- commits#L6)):
Previously, arulajmani (Arul Ajmani) wrote…
I think your commit message needs an update with the new session/cluster settings in.
Also, add a nod to the fact that you're intentionally skipping on the release note here and why.
Done.
pkg/sql/create_database.go, line 102 at r1 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
Maybe I'm lazy, but I really like when I can just copy paste the exact session setting I need to change instead of deciphering a hint message. Maybe something like "you can enable multi-region placement policy by running
SET enable_multiregion_placement_policy = truein the hint.Your call!
Makes sense!
4570f06 to
c91de7d
Compare
|
I think one of your tests is failing because you need to now turn on this cluster setting for it. That, and this needs a rebase. Should be good to go in after! |
35f1b5c to
9c79113
Compare
Previously, PLACEMENT operations were allowed by default. We want to hide these unless the user explicitly enables them, however, so this PR adds the a cluster setting to gate them. Session setting: enable_multiregion_placement_policy Cluster setting: sql.defaults.multiregion_placement_policy.enabled We have no release note for this commit because we intend to hide PLACEMENT operations from users unless they explicitly ask for them. Release note: None
9c79113 to
56f3fb6
Compare
|
bors r=arulajmani |
|
Build succeeded: |
Previously, PLACEMENT operations were allowed by default. We want to
hide these unless the user explicitly enables them, however, so this PR
adds the
sql.defaults.experimental_domicilingcluster setting to gatethem.
Release note: None
Resolves #68598