Skip to content

release-26.2: descs: evict stale SystemDatabaseCache entries on descriptor-not-found#169389

Merged
trunk-io[bot] merged 1 commit into
cockroachdb:release-26.2from
msbutler:blathers/backport-release-26.2-169351
Apr 30, 2026
Merged

release-26.2: descs: evict stale SystemDatabaseCache entries on descriptor-not-found#169389
trunk-io[bot] merged 1 commit into
cockroachdb:release-26.2from
msbutler:blathers/backport-release-26.2-169351

Conversation

@msbutler
Copy link
Copy Markdown
Collaborator

Backport 1/1 commits from #169351 on behalf of @msbutler.


Summary

PR #169044 allowed SystemDatabaseCache to accept updated name→ID mappings,
but the update path was never triggered because the stale cache hit in
lookupDescriptorID prevented the KV read that would have provided the
corrected mapping — a self-reinforcing cycle.

When getDescriptorByName resolves a system table name to an ID but the
descriptor at that ID doesn't exist, evict the entry from the
SystemDatabaseCache. The next lookup misses the cache, reads from KV, and
self-heals. This works across all nodes since the corrected namespace entry
is in shared KV storage.

Fixes #169316

Epic: none

Release note (bug fix): Fixed a bug where PCR reader tenants could
permanently fail authentication after SetupOrAdvanceStandbyReaderCatalog
rewrote the system.privileges namespace entry. A stale cached name→ID
mapping was never refreshed, causing every SQL connection to fail with
"descriptor not found".


Release justification:

PR cockroachdb#169044 allowed SystemDatabaseCache to accept updated name→ID
mappings, but the update path was never triggered because the stale
cache hit in lookupDescriptorID prevented the KV read that would
have provided the corrected mapping — a self-reinforcing cycle.

When getDescriptorByName resolves a system table name to an ID but
the descriptor at that ID doesn't exist, evict the entry from the
SystemDatabaseCache. The next lookup misses the cache, reads from
KV, and self-heals.

Fixes cockroachdb#169316

Release note (bug fix): Fixed a bug where PCR reader tenants could
permanently fail authentication after SetupOrAdvanceStandbyReaderCatalog
rewrote the system.privileges namespace entry. A stale cached name→ID
mapping was never refreshed, causing every SQL connection to fail with
"descriptor not found".

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
@msbutler msbutler force-pushed the blathers/backport-release-26.2-169351 branch from c92d572 to 96f70e1 Compare April 29, 2026 23:41
@msbutler msbutler requested a review from a team as a code owner April 29, 2026 23:41
@blathers-crl blathers-crl Bot added blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot. labels Apr 29, 2026
@trunk-io
Copy link
Copy Markdown
Contributor

trunk-io Bot commented Apr 29, 2026

😎 Merged successfully - details.

@blathers-crl blathers-crl Bot requested review from fqazi and spilchen April 29, 2026 23:41
@blathers-crl
Copy link
Copy Markdown

blathers-crl Bot commented Apr 29, 2026

Thanks for opening a backport.

Before merging, please confirm that the change does not break backwards compatibility and otherwise complies with the backport policy. Include a brief release justification in the PR description explaining why the backport is appropriate. All backports must be reviewed by the TL for the owning area. While the stricter LTS policy does not yet apply, please exercise judgment and consider gating non-critical changes behind a disabled-by-default feature flag when appropriate.

@blathers-crl blathers-crl Bot added backport Label PR's that are backports to older release branches T-disaster-recovery labels Apr 29, 2026
@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 6 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on spilchen).

@trunk-io trunk-io Bot merged commit f4183be into cockroachdb:release-26.2 Apr 30, 2026
22 of 23 checks passed
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-disaster-recovery target-release-26.2.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants