Skip to content
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

Conversation

ajwerner
Copy link
Contributor

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.

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.
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@ajwerner
Copy link
Contributor Author

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.

Copy link
Contributor

@spaskob spaskob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @lucy-zhang and @spaskob)

Copy link
Contributor

@thoszhang thoszhang left a 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: :shipit: complete! 1 of 0 LGTMs obtained

@ajwerner ajwerner merged commit 61b3971 into cockroachdb:release-19.2 Jun 29, 2020
ajwerner added a commit to ajwerner/cockroach that referenced this pull request Jun 29, 2020
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.
ajwerner added a commit to ajwerner/cockroach that referenced this pull request Jun 29, 2020
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.
ajwerner added a commit to ajwerner/cockroach that referenced this pull request Jun 29, 2020
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.
@ajwerner ajwerner changed the title sql: only set DropJobID on old table descriptor in TRUNCATE release-19.2: sql: only set DropJobID on old table descriptor in TRUNCATE Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants