Skip to content

sql/schemachanger: add version gate for DROP CONSTRAINT on unique ind…#163859

Merged
trunk-io[bot] merged 1 commit intocockroachdb:masterfrom
rafiss:fix-rsw-mixed-version
Feb 18, 2026
Merged

sql/schemachanger: add version gate for DROP CONSTRAINT on unique ind…#163859
trunk-io[bot] merged 1 commit intocockroachdb:masterfrom
rafiss:fix-rsw-mixed-version

Conversation

@rafiss
Copy link
Copy Markdown
Collaborator

@rafiss rafiss commented Feb 18, 2026

…exes

The declarative schema changer added support for ALTER TABLE ... DROP CONSTRAINT on unique constraints in 5dcf331, but did not include a cluster version gate. In mixed-version clusters (26.1 → 26.2), this caused non-deterministic behavior: requests landing on v26.2 nodes succeeded via the DSC, while requests landing on v26.1 nodes fell back to the legacy schema changer and returned a FeatureNotSupported error.

This broke the schemachange workload in mixed-version testing because it expected deterministic behavior — either always succeeding or always failing.

Add a version gate in dropUniqueIndexBackedConstraint so the DSC falls back to the legacy schema changer on all nodes until the cluster version reaches v26.2, ensuring consistent behavior during upgrades. Also update the logic tests for mixed-version configs to expect the legacy behavior.

Fixes: #163321

Release note: None

…exes

The declarative schema changer added support for ALTER TABLE ... DROP
CONSTRAINT on unique constraints in 5dcf331, but did not include a
cluster version gate. In mixed-version clusters (26.1 → 26.2), this
caused non-deterministic behavior: requests landing on v26.2 nodes
succeeded via the DSC, while requests landing on v26.1 nodes fell back
to the legacy schema changer and returned a FeatureNotSupported error.

This broke the schemachange workload in mixed-version testing because it
expected deterministic behavior — either always succeeding or always
failing.

Add a version gate in dropUniqueIndexBackedConstraint so the DSC falls
back to the legacy schema changer on all nodes until the cluster version
reaches v26.2, ensuring consistent behavior during upgrades. Also update
the logic tests for mixed-version configs to expect the legacy behavior.

Fixes: cockroachdb#163321

Release note: None

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rafiss rafiss requested a review from fqazi February 18, 2026 17:03
@rafiss rafiss requested a review from a team as a code owner February 18, 2026 17:03
@trunk-io
Copy link
Copy Markdown
Contributor

trunk-io bot commented Feb 18, 2026

😎 Merged successfully - details.

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
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.

:lgtm:

@fqazi reviewed 2 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on rafiss).

@rafiss
Copy link
Copy Markdown
Collaborator Author

rafiss commented Feb 18, 2026

tftr!

/trunk merge

@rafiss
Copy link
Copy Markdown
Collaborator Author

rafiss commented Feb 18, 2026

/trunk merge

@trunk-io trunk-io bot merged commit 020e411 into cockroachdb:master Feb 18, 2026
24 checks passed
@rafiss rafiss deleted the fix-rsw-mixed-version branch February 26, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

roachtest: schemachange/mixed-versions failed

3 participants