Skip to content

sql/catalog: ensure consistent versions during type hydration#162622

Draft
fqazi wants to merge 1 commit intocockroachdb:masterfrom
fqazi:fixHydrationDroppedHandlin
Draft

sql/catalog: ensure consistent versions during type hydration#162622
fqazi wants to merge 1 commit intocockroachdb:masterfrom
fqazi:fixHydrationDroppedHandlin

Conversation

@fqazi
Copy link
Collaborator

@fqazi fqazi commented Feb 7, 2026

Previously, if a schema had references to types being dropped, for example due to functions that were being cleaned up, it was possible to encountered "descriptor is being dropped" when leasing the schema. This happened because the version of the schema could be behind that of other objects referenced. While locked leasing eliminates issues for non-dropped objects, it cannot alleviate it for any dropped descriptors that are being resolved. To address this, this patch will generate a retryable error, if we detect that a dropped type descriptor encountered after the read timestamp.

Fixes: #159509

Release note: None

Previously, if a schema had references to types being dropped, for
example due to functions that were being cleaned up, it was possible to
encountered "descriptor is being dropped" when leasing the schema. This
happened because the version of the schema could be behind that of other
objects referenced. While locked leasing eliminates issues for
non-dropped objects, it cannot alleviate it for any dropped descriptors
that are being resolved. To address this, this patch will generate a
retryable error, if we detect that a dropped type descriptor encountered
after the read timestamp.

Fixes: cockroachdb#159509

Release note: None
@trunk-io
Copy link
Contributor

trunk-io bot commented Feb 7, 2026

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

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.

roachtest: schemachange/mixed-versions failed [failed generating operation: dropPolicy: descriptor is being dropped]

2 participants