forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: fix bad interraction with DROP region rollback and alter to RBR
When altering to a regional by row table we only add partitions for PUBLIC enum values (regions). The type schema change job that negotiates promotion/demotion is responsible for re-partitioning regional by row tables. Previously, this re-partitioning only happened if the type schema change job succeeded. This behavior missed an edge case, which looks like: - Client 1 drops region A from the database. The user txn commits. - Client 2 alters table t to a RBR. - The drop region fails, and therefore rolls back. - table t is now missing a partition for region A. This patch fixes this problem by trigerring a re-partition even when the type schema change job is rolling back. Informs cockroachdb#63462 Release note (bug fix): Previously if a user altered a table to REGIONAL BY ROW when a region was being dropped, and the drop failed and had to be rolled back, it could have resulted in the Regional By Row table missing a partition for this region. This is now fixed and region drop failure rollbacks are sane.
- Loading branch information
1 parent
5f8c966
commit eef0cbb
Showing
2 changed files
with
156 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters