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

sql/schemachanger: block legacy schema changer operations earlier #99438

Merged
merged 1 commit into from
Mar 24, 2023

Conversation

fqazi
Copy link
Collaborator

@fqazi fqazi commented Mar 23, 2023

Previously, it was possible for ADD/DROP CONSTRAINT and other declarative schema changer operations to collide with DROP TABLE in the legacy schema changer, since our gate was not early enough. So, some work would be done before the schema change was blocked with a retry error.
This patch prevents DROP TABLE/VIEW/SEQUENCE from executing until a declarative schema change on such objects is completed earlier.

Fixes: #99379

Release note: None

Previously, it was possible for ADD/DROP CONSTRAINT and
other declarative schema changer operations to collide with
DROP TABLE in the legacy schema changer, since our gate
was not early enough. So, some work would be done before
the schema change was blocked with a retry error.
This patch prevents DROP TABLE/VIEW/SEQUENCE from
executing until a declarative schema change on such
objects is completed earlier.

Fixes: cockroachdb#99379

Release note: None
@blathers-crl
Copy link

blathers-crl bot commented Mar 23, 2023

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@fqazi fqazi marked this pull request as ready for review March 24, 2023 14:01
@fqazi fqazi requested a review from a team March 24, 2023 14:01
@fqazi
Copy link
Collaborator Author

fqazi commented Mar 24, 2023

@chengxiong-ruan TFTR

bors r+

@fqazi
Copy link
Collaborator Author

fqazi commented Mar 24, 2023

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 24, 2023

Build succeeded:

@craig craig bot merged commit a9e90a6 into cockroachdb:master Mar 24, 2023
@rafiss
Copy link
Collaborator

rafiss commented Mar 27, 2023

blathers backport 23.1

@rafiss rafiss added the backport-23.1.x Flags PRs that need to be backported to 23.1 label Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.1.x Flags PRs that need to be backported to 23.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sql: drop table does not block early enough against declarative schema changer
4 participants