cockroachdb / cockroachdb/cockroach

doctor: reorder recreate statements by type of descriptor

Open
#108,738 0 comments 0 reactions 0 assignees View on GitHub
A-sql-cli-observability C-enhancement quality-friday T-sql-foundations
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

The output of `cockroach debug doctor recreate` sometimes generates SQL that requires some manual reordering in order to execute without errors.

The errors are also often pretty cryptic:
```
ERROR: internal error: crdb_internal.unsafe_upsert_descriptor(): expected mutated relation, instead got a database
```

One cause of errors is the statements for recreating schemas not appearing before the statements for recreating databases.

We should update the debug doctor logic to dump the SQL in an order that executes without errors to alleviate the burden of recreating a cluster's schema from a debug zip.

Jira issue: CRDB-30618

Epic CRDB-48808

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.