-
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-19.2: sql: only set DropJobID on old table descriptor in TRUNCATE #50714
release-19.2: sql: only set DropJobID on old table descriptor in TRUNCATE #50714
Conversation
Prior to this commit, we'd populate the DropJobID in both the new and old tables when truncating a table. This causes problems later. Note that this commit does not add robustness to clusters which have table descriptors with a DropJobID due to this bug. That will come in a follow-up. Touches cockroachdb#50587. Release note (bug fix): Fixed a bug in TRUNCATE which could later leave tables in a state where they cannot be renamed.
I'll be issuing a separate PR to add robustness to this situation as that PR should merge to master and get backported to 20.1, 19.2, and 19.1. |
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! 1 of 0 LGTMs obtained (waiting on @lucy-zhang and @spaskob)
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 2 of 2 files at r1.
Reviewable status: complete! 1 of 0 LGTMs obtained
In cockroachdb#50587 we discovered that TRUNCATE would leave a DropJobID on both the new and old tables. This situation was rectified in cockroachdb#50714. In most cases that job ID is ignored. However, in release-19.2 and earlier, it would prevent RENAME operations from completing. To deal with this, we repair the descriptor by removing the DropJobID. We also, for additional protection, prevent the failure to update the job from preventing progress. Release note (bug fix): Fixed a bug which could prevent previously TRUNCATED tables from being renamed.
In cockroachdb#50587 we discovered that TRUNCATE would leave a DropJobID on both the new and old tables. This situation was rectified in cockroachdb#50714. In most cases that job ID is ignored. However, in release-19.2 and earlier, it would prevent RENAME operations from completing. To deal with this, we repair the descriptor by removing the DropJobID. We also, for additional protection, prevent the failure to update the job from preventing progress. Release note (bug fix): Fixed a bug which could prevent previously TRUNCATED tables from being renamed.
In cockroachdb#50587 we discovered that TRUNCATE would leave a DropJobID on both the new and old tables. This situation was rectified in cockroachdb#50714. In most cases that job ID is ignored. However, in release-19.2 and earlier, it would prevent RENAME operations from completing. To deal with this, we repair the descriptor by removing the DropJobID. We also, for additional protection, prevent the failure to update the job from preventing progress. Release note (bug fix): Fixed a bug which could prevent previously TRUNCATED tables from being renamed.
Prior to this commit, we'd populate the DropJobID in both the new and old
tables when truncating a table. This causes problems later. Note that this
commit does not add robustness to clusters which have table descriptors with
a DropJobID due to this bug. That will come in a follow-up.
Touches #50587.
Release note (bug fix): Fixed a bug in TRUNCATE which could later leave
tables in a state where they cannot be renamed.