multitenant: add tenant end key split to MetadataSchema#99246
multitenant: add tenant end key split to MetadataSchema#99246craig[bot] merged 2 commits intocockroachdb:masterfrom ecwall:multitenant_end_key_split_metadata
Conversation
rafiss
left a comment
There was a problem hiding this comment.
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?
ecwall
left a comment
There was a problem hiding this comment.
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.
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