-
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: set locality to GLOBAL for materialized views #62122
sql: set locality to GLOBAL for materialized views #62122
Conversation
Nice speedy work! |
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 13 of 13 files at r1, 3 of 3 files at r2, 2 of 2 files at r3.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @miretskiy and @otan)
pkg/sql/catalog/tabledesc/validate.go, line 1253 at r2 (raw file):
// Check non-table items have a correctly set locality. if desc.IsSequence() { if !desc.IsLocalityRegionalByTable() {
Nit: Does it make sense here to create IsDefaultLocalitySequence and tree.DefaultLocalitySequence, so that we only have to change this in one place down the road?
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @miretskiy and @otan)
pkg/sql/create_sequence.go, line 91 at r1 (raw file):
func doCreateSequence( params runParams, context string,
mind removing this context? Looks greyed out
pkg/sql/create_sequence.go, line 98 at r1 (raw file):
opts tree.SequenceOptions, jobDesc string, isMultiRegion bool,
nit: you can get rid of this param and construct isMultiRegion
in this function as opposed to funnelling it through to here.
pkg/sql/create_table.go, line 2419 at r1 (raw file):
} _, dbDesc, err := params.p.Descriptors().GetImmutableDatabaseByID(
Don't you need an AvoidCached
version here?
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.
suggestions changed on base PR
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @ajstorm, @arulajmani, and @miretskiy)
pkg/sql/create_sequence.go, line 91 at r1 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
mind removing this context? Looks greyed out
Done.
pkg/sql/create_table.go, line 2419 at r1 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
Don't you need an
AvoidCached
version here?
Done.
pkg/sql/catalog/tabledesc/validate.go, line 1253 at r2 (raw file):
Previously, ajstorm (Adam Storm) wrote…
Nit: Does it make sense here to create IsDefaultLocalitySequence and tree.DefaultLocalitySequence, so that we only have to change this in one place down the road?
hmm, i don't see the value of it so much right now as i imagine the way we go forwards from here is allowing users to configure it.
depends how strongly you feel. happy to do this in a follow up.
dd1f652
to
45757fb
Compare
Release note (sql change): Materialized views in multi-region databases will now have a GLOBAL locality.
Release note (sql change): Materialized views which are in a database before the first ADD REGION will become GLOBAL on ADD REGION, in line with the behavior of CREATE MATERIALIZED VIEW on a multi-region database.
45757fb
to
f7bf627
Compare
bors r=ajstorm |
Build succeeded: |
Only last two commits matter.
See individual commits for details.
Refs: #61382