cockroachdb / cockroachdb/cockroach
doctor: reorder recreate statements by type of descriptor
- 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
Assessment
This issue has not been assessed yet.