cockroachdb / cockroachdb/cockroach

sql: easier way to get a history of all versions of a descriptor

Open
#107,904 4 comments 0 reactions 0 assignees View on GitHub
C-enhancement E-starter quality-friday T-sql-foundations
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

With a historic view of descriptor changes over time for a schema would be super helpful for debugging potential Schema Changer bugs. We do have a few ways currently to achieve the similar goal, but they seems not straight forward or customer has chances to opt out:
(1) as @fqazi mentioned that we dump descriptor jsons in lease renewal messages, so that we could check through debugzip loggings to get older version descriptors. This might fit our goal, but it can be more explicit. Also logs has retention period. It may not last for more than a couple weeks.
(2) we have schema telemetry job which takes snapshots of schema data periodically. But it does not necessary has enough granularity and precision we would need if multiple schema changes happened within one snapshot window.

An alternative to the above is to maintain a `system.descriptor_history` table to track all versions. We may manage a retention ttl as well, if extra disk space is a concern. But it maybe only an concern for database with a lot of descriptors.

Jira issue: CRDB-30251

Epic CRDB-30352

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.