-
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
release-20.2: sql: fix bug where bad mutation job state could block dropping tables #58255
Merged
thoszhang
merged 2 commits into
cockroachdb:release-20.2
from
thoszhang:backport20.2-56589-57836
Dec 24, 2020
Merged
release-20.2: sql: fix bug where bad mutation job state could block dropping tables #58255
thoszhang
merged 2 commits into
cockroachdb:release-20.2
from
thoszhang:backport20.2-56589-57836
Dec 24, 2020
Conversation
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
Previously, if a drop table statement was executed in a transaction following other schema changes to the table in the same transaction, an error would occur. This error was due to the drop table statement marking previous jobs as succeeded and then proceeding to modify them. This change ensures that drop table statement will delete all existing jobs from the job cache so that it does not interfere with previous jobs. Release note (sql change): A table can successfully be dropped in a transaction following other schema changes to the table in the same transaction.
The race detector does not like this test. Let me fix it. |
Previously, while dropping a table, we would mark all the jobs associated with mutations on the table as `succeeded`, under the assumption that they were running. The job registry API prohibits this when the jobs are not `running` (or `pending`), so if a mutation was stuck on the table descriptor with a failed or nonexistent job, dropping the table would fail. This PR fixes the bug by checking the job state before attempting to update the job. It also fixes a related failure to drop a table caused by a valid mutation job not being in a `running` state. Release note (bug fix): Fixed a bug where prior schema changes on a table that failed and could not be fully reverted could prevent the table from being dropped.
thoszhang
force-pushed
the
backport20.2-56589-57836
branch
from
December 23, 2020 23:27
8b4596a
to
43f27d6
Compare
Should be fine now. |
ajwerner
approved these changes
Dec 23, 2020
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, 2 of 2 files at r2.
Reviewable status: complete! 1 of 0 LGTMs obtained
This is hitting #51544. I'm just going to re-run the tests. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport:
Please see individual PRs for details.
/cc @cockroachdb/release