Skip to content

Conversation

spilchen
Copy link
Contributor

@spilchen spilchen commented Aug 29, 2025

Backport 1/1 commits from #152670.

/cc @cockroachdb/release


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.

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 self-assigned this Aug 29, 2025
@spilchen spilchen requested a review from a team as a code owner August 29, 2025 17:36
Copy link

blathers-crl bot commented Aug 29, 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 29, 2025
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link

blathers-crl bot commented Aug 29, 2025

✅ PR #152744 is compliant with backport policy

Confidence: high
Critical bug criteria met: [Bugs that can cause the DB to return incorrect results or result in suboptimal performance]
Backward compatible: true
Explanation: The pull request qualifies for a policy exception due to its release justification "low-risk bug fix that surfaced through a sentry report to prevent false positives when identifying descriptor corruptions." This justification adequately explains why the fix is necessary and relevant for a backport, aligning with the criteria for bugs that can cause the DB to return incorrect results or result in suboptimal performance. Furthermore, the specific changes are to a test file and production code modifying behavior related to multi-region validation, properly addressing the identified issues. Changes in the production file are evaluated to be low-risk and backward-compatible as they only change condition checks without removing existing functionalities or breaking API compatibility. This updated validation exempts views from certain checks, which fixes an issue without introducing backward-incompatible changes or removing version gates.

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

@spilchen spilchen requested a review from rafiss August 29, 2025 17:36
@spilchen spilchen merged commit 602d77c into cockroachdb:release-24.1 Sep 2, 2025
16 checks passed
@spilchen spilchen deleted the backport24.1-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 T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) v24.1.24
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants