Skip to content

Conversation

@rafiss
Copy link
Collaborator

@rafiss rafiss commented Nov 14, 2025

Previously, if a rollback dropped a constraint due to a FK validation error, it would never update the RBRUsingConstraint field even if the constraint being rolled back was referenced by that field.

Now the field is cleared properly when needed.

fixes #157832

Release note (bug fix): Fixed a bug that could cause a schema change to be stuck in the reverting state if the infer_rbr_region_col_using_constraint storage parameter was being set at the same time as adding a constraint that had a foreign key violation.

Previously, if a rollback dropped a constraint due to a FK validation
error, it would never update the RBRUsingConstraint field even if the
constraint being rolled back was referenced by that field.

Now the field is cleared properly when needed.

Release note (bug fix): Fixed a bug that could cause a schema change to
be stuck in the reverting state if the infer_rbr_region_col_using_constraint
storage parameter was being set at the same time as adding a constraint
that had a foreign key violation.
@rafiss rafiss requested review from DrewKimball and fqazi November 14, 2025 16:17
@rafiss rafiss added the backport-25.3.x Flags PRs that need to be backported to 25.3 label Nov 14, 2025
@rafiss rafiss requested a review from a team as a code owner November 14, 2025 16:17
@rafiss rafiss added the backport-25.4.x Flags PRs that need to be backported to 25.4 label Nov 14, 2025
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@fqazi fqazi left a comment

Choose a reason for hiding this comment

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

@rafiss nice find! :lgtm:

@fqazi reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @DrewKimball)

@rafiss
Copy link
Collaborator Author

rafiss commented Nov 14, 2025

tftr!

bors r+

@craig
Copy link
Contributor

craig bot commented Nov 14, 2025

@craig craig bot merged commit 7e40539 into cockroachdb:master Nov 14, 2025
32 of 33 checks passed
@blathers-crl
Copy link

blathers-crl bot commented Nov 14, 2025

Based on the specified backports for this PR, I applied new labels to the following linked issue(s). Please adjust the labels as needed to match the branches actually affected by the issue(s), including adding any known older branches.


Issue #157832: branch-release-25.4.


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-25.3.x Flags PRs that need to be backported to 25.3 backport-25.4.x Flags PRs that need to be backported to 25.4 v26.1.0-prerelease

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sql,schema_changer: rolling back infer_rbr_region_col_using_constraint can get stuck forever

3 participants