cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.15k stars 3.81k forks source link

Expose crdb_internal.invalid_objects inside the console UI #107568

Open fqazi opened 1 year ago

fqazi commented 1 year ago

Is your feature request related to a problem? Please describe. Clusters can potentially have descriptor corruption because of schema changer bugs, which can lead to upgrade issues or inaccessible tables. Fortunately Cockroach DB has builtin diagnostics for these using the crdb_internal.invalid_objects table.

Describe the solution you'd like We should periodically have the console scan crdb_internal.invalid_objects and have some type of notification for database administration when descriptor issues are addressed. This will allow for administrators to be aware of any potential upgrade issues earlier.

Describe alternatives you've considered

Additional context This is important also in reference to a recent TA: https://www.cockroachlabs.com/docs/advisories/a99561 where this CRDB internal table now reports this problem

Jira issue: CRDB-30112

rafiss commented 1 year ago

A related approach is the idea in https://github.com/cockroachdb/cockroach/issues/104266#issuecomment-1654209072 -- we could add a metric that shows the size of the crdb_internal.invalid_objects table. It's possible that just showing the size alone is enough to be helpful, and if it's non-zero the customer can look at the table manually. If that's fine, we may not need to resolve this ticket.