-
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
multitenant: add tenant end key split to MetadataSchema #99246
multitenant: add tenant end key split to MetadataSchema #99246
Conversation
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.
nice
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 @arulajmani and @ecwall)
pkg/sql/catalog/bootstrap/metadata.go
line 279 at r1 (raw file):
records = append(records, record{k: s}) } // Strip the tenant prefix if there is one.
the "if there is one" comment that was here seems to imply that the prefix may or may not be present. after this change, should we assert somehow that the prefix is always present?
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 @arulajmani and @rafiss)
pkg/sql/catalog/bootstrap/metadata.go
line 279 at r1 (raw file):
Previously, rafiss (Rafi Shamim) wrote…
the "if there is one" comment that was here seems to imply that the prefix may or may not be present. after this change, should we assert somehow that the prefix is always present?
The prefix won't be present for the system tenant because it does not have a prefix. I think the comment was indicating that it will strip secondary tenants' prefixes.
Fixes #97985 Previously #95100 created tenant end key split points asynchronously which allowed for a brief period after tenant creation where the tenant's keyspace had an end key of /Max instead of the next tenant's start key. This change creates that split point synchronously on tenant creation to avoid race conditions. Release note: None
This function was added as part of #95100 to block until the tenant's end key split point was created asynchronously, but is no longer needed because the tenant end key split point is created synchronously on tenant creation. Release note: None
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.
First commit looks good!
Reviewed 3 of 5 files at r2, 9 of 9 files at r4.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @arulajmani and @rafiss)
bors r=knz |
Build succeeded: |
Fixes #97985
Previously #95100 created tenant end key split points asynchronously which
allowed for a brief period after tenant creation where the tenant's keyspace
had an end key of /Max instead of the next tenant's start key.
This change creates that split point synchronously on tenant creation to avoid
race conditions.
Release note: None