cockroachdb / cockroachdb/cockroach

kvserver: easily force garbage collection and compaction

Open
#105,808 4 comments 0 reactions 0 assignees View on GitHub
C-enhancement T-kv
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

Users often ask how they can quickly free up disk space by running garbage collection. This often involves an annoying amount of settings tweaks and queue prodding.

We should make it easy to force garbage collection of specific spans/tables/databases/etc. This should run MVCC garbage collection and Pebble compactions, and display progress and a summary to the user. This must still respect the GC TTL and protected timestamps (but should output these to the user to explain why all garbage isn't being removed).

It should optionally be possible to override both GC TTLs and protected timestamps, e.g. "just remove all the garbage, I don't care if it breaks backups or changefeeds, or if it violates the GC TTL".

This could be solved in any number of ways: a SQL builtin, a job, a CLI tool, a DB console button, etc. We could even present it as a first-class concept, e.g. a "garbage" database showing tables and data that's been deleted and is pending GC, where deleting/truncating from the database would garbage collect the item.

See also [internal discussion](https://cockroachlabs.slack.com/archives/C0KB9Q03D/p1687977202918039?thread_ts=1687964552.380039&cid=C0KB9Q03D).

Jira issue: CRDB-29211

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.