-
Notifications
You must be signed in to change notification settings - Fork 555
db: elision-only L6 compactions #838
Description
There are a couple circumstances through which a tombstone may be written to a L6 file. An open snapshot can prevent a tombstone's elision during an ordinary compaction, and a move compaction can move a file containing tombstones into L6.
When (if any) blocking snapshots are closed, these tombstones and any covered keys within the same sstable may be elided. Today, this doesn't happen until the compaction of an overlapping file in the above level. These sstables unnecessarily consume disk space, and their point tombstones can introduce latency to range iteration. It's also surprising to have a database with zero keys, zero snapshots and a non-zero number of sstables (cockroachdb/cockroach#51786).
A relevant TODO: https://github.com/cockroachdb/pebble/blob/master/compaction_picker.go#L957-L959