Skip to content

Conversation

spilchen
Copy link
Contributor

@spilchen spilchen commented Aug 28, 2025

Backport 1/1 commits from #152670 on behalf of @spilchen.


Previously, views using crdb_region in expressions were incorrectly rejected by multi-region validation. The logic assumed that region enums must correspond to explicit columns in the descriptor, failing to account for views that reference crdb_region from underlying tables.

This change updates the validation to allow such expressions in views.

Fixes #151216
Fixes #152197

Release note (bug fix): views can now reference the crdb_region column from underlying tables in expressions.


Release justification: low-risk bug fix that surfaced through a sentry report to prevent false positives when identifying descriptor corruptions, which could interfere with normal cluster operation.

Previously, views using `crdb_region` in expressions were incorrectly rejected
by multi-region validation. The logic assumed that region enums must correspond
to explicit columns in the descriptor, failing to account for views that
reference `crdb_region` from underlying tables.

This change updates the validation to allow such expressions in views.

Fixes cockroachdb#151216

Release note (bug fix): views can now reference the `crdb_region` column from
underlying tables in expressions.
@spilchen spilchen force-pushed the blathers/backport-release-25.2-152670 branch from b969257 to fbb1cd7 Compare August 28, 2025 18:24
@spilchen spilchen requested a review from a team as a code owner August 28, 2025 18:24
@blathers-crl blathers-crl bot added blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot. labels Aug 28, 2025
@blathers-crl blathers-crl bot requested a review from rafiss August 28, 2025 18:24
Copy link

blathers-crl bot commented Aug 28, 2025

Thanks for opening a backport.

Before merging, please confirm that it falls into one of the following categories (select one):

  • Non-production code changes. Includes test-only changes, build system changes, etc.
  • Fixes for serious issues. Defined in the policy as correctness, stability, or security issues, data corruption/loss, significant performance regressions, breaking working and widely used functionality, or an inability to detect and debug production issues.
  • Other approved changes. These changes must be gated behind a disabled-by-default feature flag unless there is a strong justification not to.

Add a brief release justification to the PR description explaining your selection.

Also, confirm that the change does not break backward compatibility and complies with all aspects of the backport policy.

All backports must be reviewed by the TL and EM for the owning area.

@blathers-crl blathers-crl bot added backport Label PR's that are backports to older release branches T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) labels Aug 28, 2025
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link

blathers-crl bot commented Aug 28, 2025

✅ PR #152679 is compliant with backport policy

Confidence: high
Critical bug criteria met: [Stability or security issues Bugs that can cause the DB to return incorrect results or result in suboptimal performance]
Backward compatible: true
Explanation: The pull request is compliant with the backport policy due to the presence of a valid 'Release justification' and the fix addressing a critical bug. The changed production file, 'validate_table.go', updates logic to exempt views from crdb_region validation, which is critical to prevent descriptor corruption and ensure proper cluster operations. The change fixes false positives in the multiregion feature, thereby increasing the reliability of the database in multiregion deployments. The non-production file 'multi_region' in the testdata directory only includes additional test cases specifically validating the new behavior in various scenarios, showing no impact on production deployment and usage.

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

@spilchen spilchen merged commit f02b3e2 into cockroachdb:release-25.2 Sep 2, 2025
25 of 26 checks passed
@spilchen spilchen deleted the blathers/backport-release-25.2-152670 branch September 2, 2025 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Label PR's that are backports to older release branches blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) v25.2.6
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants