-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
release-23.2: catalog: add descriptor repair to remove missing roles #124665
Conversation
Thanks for opening a backport. Please check the backport criteria before merging:
If your backport adds new functionality, please ensure that the following additional criteria are satisfied:
Also, please add a brief release justification to the body of your PR to justify this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this should account for node also. maybe we should backport some of the changes i'm adding in #124772
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @dhartunian and @fqazi)
pkg/sql/crdb_internal.go
line 6155 at r1 (raw file):
} doError(catalog.ValidateRolesInDescriptor(descriptor, func(username username.SQLUsername) (bool, error) { if username.IsRootUser() ||
does this also need to exclude the node
user? otherwise, it will report errors on internal objects that are owned by node
. i created #124772
pkg/sql/crdb_internal.go
line 6620 at r1 (raw file):
(SELECT username FROM system.users UNION SELECT 'public' as username)
what about node
?
pkg/sql/sem/builtins/builtins.go
line 5426 at r1 (raw file):
(SELECT username FROM system.users UNION SELECT 'public' as username)
should node
go here too?
Previously, we had a bug that could lead to descriptors having privileages to roles that no longer exist. This could lead to certain commands like SHOW GRANTS breaking. To address this, this patch will add descirptor repair logic to automatically clean up oprhaned privileges. Fixes: cockroachdb#122552 Release note (bug fix): Add automated clean up / validation for dropped roles inside descriptors.
7f2f15b
to
14917c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @dhartunian and @rafiss)
pkg/sql/crdb_internal.go
line 6155 at r1 (raw file):
Previously, rafiss (Rafi Shamim) wrote…
does this also need to exclude the
node
user? otherwise, it will report errors on internal objects that are owned bynode
. i created #124772
Done.
pkg/sql/crdb_internal.go
line 6620 at r1 (raw file):
Previously, rafiss (Rafi Shamim) wrote…
what about
node
?
Done.
pkg/sql/sem/builtins/builtins.go
line 5426 at r1 (raw file):
Previously, rafiss (Rafi Shamim) wrote…
should
node
go here too?
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @dhartunian)
@rafiss @dhartunian TFTR! |
Backport 1/1 commits from #122557.
/cc @cockroachdb/release
Previously, we had a bug that could lead to descriptors having privileages to roles that no longer exist. This could lead to certain commands like SHOW GRANTS breaking. To address this, this patch will add descirptor repair logic to automatically clean up oprhaned privileges.
Fixes: #122552
Release note (bug fix): Add automated clean up / validation for dropped roles inside descriptors.
Release justification: low risk fix that prevents corrupt descriptors from impacting SHOW GRANTS