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-20.2: sql: make schema change jobs for databases and schemas non-cancelable #61254

Merged
merged 1 commit into from
Mar 1, 2021

Conversation

thoszhang
Copy link
Contributor

Backport 1/1 commits from #61210.

/cc @cockroachdb/release


Schema change jobs to drop, rename, or change privileges on databases
and schemas cannot be meaningfully reverted, because they just wait for
leases to drain, or handle draining names when applicable. Currently, if
we ever enter OnFailOrCancel for a schema change job on a database or
schema, we return with an error. This PR reduces the risk of this
happening by disallowing cancelation of these jobs.

Partially addresses #59545.

Release note (bug fix): Schema change jobs associated with databases and
schemas can no longer be canceled. Such jobs cannot actually be reverted
successfully, so cancelation had no benefit and could have caused
namespace corruption.

@thoszhang thoszhang requested a review from ajwerner March 1, 2021 14:24
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 4 of 4 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

Schema change jobs to drop, rename, or change privileges on databases
and schemas cannot be meaningfully reverted, because they just wait for
leases to drain, or handle draining names when applicable. Currently, if
we ever enter `OnFailOrCancel` for a schema change job on a database or
schema, we return with an error. This PR reduces the risk of this
happening by disallowing cancelation of these jobs.

Release note (bug fix): Schema change jobs associated with databases and
schemas can no longer be canceled. Such jobs cannot actually be reverted
successfully, so cancelation had no benefit and could have caused
namespace corruption.
@thoszhang
Copy link
Contributor Author

Ran into #58353. I also had to add a few extra USE statements to compensate for not being able to use database.schema names and using multiple connections.

@thoszhang thoszhang merged commit 03e2ac7 into cockroachdb:release-20.2 Mar 1, 2021
@thoszhang thoszhang deleted the backport20.2-61210 branch March 1, 2021 18:15
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.

3 participants