Skip to content
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

upgrades: make descriptor migrations more robust in the face of corruption #85265

Closed
postamar opened this issue Jul 28, 2022 · 1 comment · Fixed by #105832
Closed

upgrades: make descriptor migrations more robust in the face of corruption #85265

postamar opened this issue Jul 28, 2022 · 1 comment · Fixed by #105832
Assignees
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@postamar
Copy link
Contributor

postamar commented Jul 28, 2022

Particularly in the face of corrupt back-references. Invalid back-references should simply be removed automatically.

Jira issue: CRDB-18255

Epic CRDB-28665

@postamar postamar added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) O-postmortem Originated from a Postmortem action item. branch-release-22.1 Used to mark GA and release blockers, technical advisories, and bugs for 22.1 labels Jul 28, 2022
@blathers-crl blathers-crl bot added the T-sql-schema-deprecated Use T-sql-foundations instead label Jul 28, 2022
@postamar postamar self-assigned this Aug 2, 2022
@postamar postamar removed their assignment Sep 16, 2022
@postamar postamar changed the title upgrades: make 22.1 upgrades more robust in the face of descriptor corruption upgrades: make descriptor migrations more robust in the face of corruption Nov 10, 2022
@exalate-issue-sync exalate-issue-sync bot removed the O-postmortem Originated from a Postmortem action item. label Mar 1, 2023
@exalate-issue-sync exalate-issue-sync bot added T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) and removed T-sql-schema-deprecated Use T-sql-foundations instead labels May 10, 2023
@rimadeodhar rimadeodhar removed the branch-release-22.1 Used to mark GA and release blockers, technical advisories, and bugs for 22.1 label Jun 9, 2023
@rafiss
Copy link
Collaborator

rafiss commented Jun 15, 2023

related to #104425

postamar pushed a commit to postamar/cockroach that referenced this issue Jul 4, 2023
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.
postamar pushed a commit to postamar/cockroach that referenced this issue Jul 5, 2023
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.
craig bot pushed a commit that referenced this issue Jul 5, 2023
105832: upgrades: try to repair catalog corruptions during upgrade r=postamar a=postamar

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.

106185: sql: fix nil pointer dereference in crdb_internal.transaction_contention_events r=zachlite a=zachlite

`schemaDesc` was not checked for a nil pointer before dereferencing it. `schemaDesc` can be nil under the following conditions:

1. A schema descriptor can be deleted, in which case all of its tables would be deleted too.

2. The transaction used to retrieve the descriptor fails.

Given the structure of `getContentionEventInfo`, this nil pointer dereference is only possible under scenario 2: If a schema and its tables are deleted, a nil table descriptor would force an early return, and this code path would not execute.

Fixes: #104406
Epic: none
Release note: None

Co-authored-by: Marius Posta <[email protected]>
Co-authored-by: zachlite <[email protected]>
@craig craig bot closed this as completed in 04bb9e7 Jul 5, 2023
postamar pushed a commit to postamar/cockroach that referenced this issue Jul 6, 2023
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants