-
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.1: upgrades: try to repair catalog corruptions during upgrade #106217
release-23.1: upgrades: try to repair catalog corruptions during upgrade #106217
Conversation
Thanks for opening a backport. Please check the backport criteria before merging:
If some of the basic criteria cannot be satisfied, ensure that the exceptional criteria are satisfied within.
Add a brief release justification to the body of your PR to justify this backport. Some other things to consider:
|
85d5621
to
ca1fd55
Compare
Previously, function descriptors were not validated when querying this virtual table. This patch fixes this. Informs cockroachdb#104418. Release note: None
Descriptor repairs which can be done in post-deserialization should always be performed then and not elsewhere, otherwise we jeopardize the effectiveness of the recently-added catalog corruption repair builtin. This has no impact otherwise. Release note: None
This virtual view lists system.descriptor and system.namespace entries which can be repaired using crdb_internal.unsafe_* and crdb_internal.repaired_descriptor builtin functions. Conceptually, this view can be thought of as a projection from crdb_internal.invalid_objects: anything that shows up in this view should also show up in that table. Informs cockroachdb#104425. Release note: None
This new builtin is meant to be used with the recently-added crdb_internal.kv_repairable_catalog_corruptions virtual table. Typically, SELECT crdb_internal.repair_catalog_corruption(id, corruption) FROM "".crdb_internal.kv_repairable_catalog_corruptions will ensure that a subsequent query of the vtable will return empty. Informs cockroachdb#104425. Release note: None
This change enhances the recently-added upgrade precondition check which checks for catalog corruptions by trying to repair these automatically when possible. Fixes: cockroachdb#104425 Fixes: cockroachdb#85265 Release note (general change): upgrading the cluster version to a new release will not only check for descriptor- and other catalog corruptions but will attempt to repair some of them on a best-effort basis. This should seamlessly get rid of all longstanding descriptor back-reference corruptions, which typically don't manifest themselves until a schema change or an upgrade are performed.
ca1fd55
to
7a6036d
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.
Just one minor comment, think some extra stuff was picked up in the logic test backport. Though it looks harmless and related to sorting.
Reviewed 1 of 1 files at r1, 6 of 6 files at r2, 16 of 16 files at r3, 4 of 4 files at r4, 4 of 4 files at r5, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @postamar)
pkg/sql/logictest/testdata/logic_test/pg_builtins
line 652 at r3 (raw file):
option_name option_value query TT colnames,nosort
What are these linked to?
Good of you to notice! Someone added sorting of those result sets but forgot or omitted to backport that change. I think it's harmless too. |
Thanks for the quick review Faizan! |
Backport 5/5 commits from #105832.
/cc @cockroachdb/release
Release justification: low-risk high-reward automatic descriptor corruption repair
This change enhances the recently-added upgrade precondition check which
checks for catalog corruptions by trying to repair these automatically
when possible.
Fixes: #104425
Fixes: #85265
Release note (general change): upgrading the cluster version to a new
release will not only check for descriptor- and other catalog
corruptions but will attempt to repair some of them on a best-effort
basis. This should seamlessly get rid of all longstanding descriptor
back-reference corruptions, which typically don't manifest themselves
until a schema change or an upgrade are performed.