Skip to content

release-26.1: backup: clear default privileges on database and schema descriptors during restore#166182

Merged
rafiss merged 2 commits intocockroachdb:release-26.1from
spilchen:blathers/backport-release-26.1-165997
Mar 19, 2026
Merged

release-26.1: backup: clear default privileges on database and schema descriptors during restore#166182
rafiss merged 2 commits intocockroachdb:release-26.1from
spilchen:blathers/backport-release-26.1-165997

Conversation

@spilchen
Copy link
Contributor

@spilchen spilchen commented Mar 19, 2026

Backport 2/2 commits from #165997 on behalf of @spilchen.


During non-cluster restore, default privileges on database descriptors were carried over verbatim from the backup, potentially referencing users that don't exist on the target cluster. Clear them alongside regular privileges, which are already reset to defaults.

The second commit extends the first fix to also clear default privileges on schema
descriptors during non-cluster restore. Schemas can also carry default
privileges referencing users that don't exist on the target cluster.

Closes #164961
Epic: none
Release note (bug fix): Fixed a bug where restoring a database backup containing default privileges referencing non-existent users would leave dangling user references in the restored database descriptor.


Release justification: fix bug observed in production that causes descriptor corruption

spilchen and others added 2 commits March 17, 2026 18:17
During non-cluster restore, default privileges on database descriptors
were carried over verbatim from the backup, potentially referencing users
that don't exist on the target cluster. Clear them alongside regular
privileges, which are already reset to defaults.

Closes cockroachdb#164961
Epic: none
Release note (bug fix): Fixed a bug where restoring a database backup
containing default privileges referencing non-existent users would leave
dangling user references in the restored database descriptor.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…store

Extend the previous fix to also clear default privileges on schema
descriptors during non-cluster restore. Schemas can also carry default
privileges referencing users that don't exist on the target cluster.

Release note: None
Epic: none

Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
@spilchen spilchen requested review from a team as code owners March 19, 2026 16:35
@spilchen spilchen requested review from andrew-r-thomas and removed request for a team March 19, 2026 16:35
@blathers-crl blathers-crl bot added blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot. labels Mar 19, 2026
@blathers-crl blathers-crl bot requested review from dt and rafiss March 19, 2026 16:35
@blathers-crl
Copy link

blathers-crl bot commented Mar 19, 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-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) labels Mar 19, 2026
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@rafiss rafiss merged commit 894445f into cockroachdb:release-26.1 Mar 19, 2026
20 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-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) target-release-26.1.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants