cockroachdb / cockroachdb/cockroach

kvserver: use count of encountered MVCC tombstones as GC signal

Open
#98,561 0 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

**Is your feature request related to a problem? Please describe.**

See https://github.com/cockroachdb/cockroach/issues/17229#issuecomment-1460942252. In this issue, @a-robinson ended up with a range that wasn't eligible for GC even though most of the shadowed data was GC'able, because the GC'able data represented only a small portion of the range. However, this small portion of the range was hot and so performance suffered.

**Describe the solution you'd like**

We could capture stats the rate at which shadowed versions are skipped and use this to influence the aggressiveness of GC. In particular, the `DeadFraction`[^1] should not lower the score when the shadowed data is read at a high rate.

[^1]: https://github.com/cockroachdb/cockroach/blob/736a67e0d36cc545bf74d65db069ee895ff9bea0/pkg/kv/kvserver/mvcc_gc_queue.go#L457

Jira issue: CRDB-25331

Contributor guide

Open the contributing guide

Research direction

Start with pkg/kv/kvserver/mvcc_gc_queue.go, especially the DeadFraction reference, and read the linked discussion in issue 17229. Determine how encountered MVCC tombstones and the rate of skipped shadowed versions should influence GC aggressiveness, then verify that hot shadowed data can raise the GC signal.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.