-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
release-21.1: block concurrent ADD/DROP REGION and REGIONAL BY ROW changes #64255
release-21.1: block concurrent ADD/DROP REGION and REGIONAL BY ROW changes #64255
Conversation
There was an error in the `RunBeforeMultiRegionUpdates` knob such that if it were set, we would short circuit. The intention, instead, was to only short circuit in the error case. Release note: None
This is a fix to a problem facing validation - namely - the type schema changer modifies the enum and the table separately. If we change the enum first, the table no longer validates partitions correctly. We can't change the table partition first as the enum members are no longer public. To alleviate this, we pre-fetch the tables before the enum gets changed and re-hydrate the enum descriptor after the enum gets changed to add the new partitioning. Release note: None
This commit adds validation that partitions for a REGIONAL BY ROW table matches regions in the type descriptor. Release note: None
Multi-region tests check to ensure partitioning is sane from a few different tests. This pulls out that logic into its own function. Release note: None
This patch adds TestAlterRegionalByRowEnclosingRegionAddDrop, with the following sketch: - Client 1 performs an `ALTER TABLE ... SET LOCALITY REGIONAL BY ROW TABLE` - Let the user txn commit. - Block in the (table) schema changer. - Client 2 performs an ALTER ADD / DROP REGION. Let the operation complete (succeed or fail, depending on the particular setup). - Resume the ALTER operation in the schema changer. Currently, this ALTER operation is bound to fail because of Once the issue is addressed, this test should be updated to assert the correct partitioning values (in all cases). Release note: None
Release note (bug fix): Previously, if a DROP INDEX failed during a REGIONAL BY ROW transition, the index may be re-inserted back into the REGIONAL BY ROW table but would be invalid if it was sharded or partitioned. This is now rectified.
This is helpful for error messages which allows the schema name to be output in the error message. Release note: None
Release note (sql change): Disallow ADD/DROP REGION whilst a REGIONAL BY ROW table has index changes underway or a table is transitioning to or from REGIONAL BY ROW.
Release note (sql change): Prevent index modification on REGIONAL BY ROW tables and locality to/from REGIONAL BY ROW changes during a ADD/DROP REGION.
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.
@arulajmani can you quickly confirm that this is the necessary and sufficient list of commits to backport for this issue?
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @arulajmani)
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.
I think technically you might not need the second commit from #64017, as that test gets removed in a subsequent commit, but probably not worth the cherry-pick/conflict hassle.
Reviewable status:
complete! 1 of 0 LGTMs obtained
Backport:
Please see individual PRs for details.
/cc @cockroachdb/release