Take range deletions into account in SubcompactionState::ShouldStopBefore
- Dominant language
- C++
- Stars
- 32.1k
- Forks
- 6.9k
- Avg merge
- 32m
- Merged PRs (30d)
- 1
Description
Overlap with the grandparent level is used to control the size of future compactions, but we don't take range deletions into account when doing this, which makes it possible to unintentionally create large compactions in the future. We should also check range deletions for grandparent-level overlaps and select a grandparent boundary as the output file's upper bound (but set the seqnum to `kMaxSequenceNumber` and type to `kTypeRangeDeletion`). In the next output file, the smallest internal key should have the same user key and type (`kTypeRangeDeletion`), but have a seqnum of the largest overlapping tombstone's seqnum.
The method described above can pick a better splitting point between two files, but if the gap between those files is especially large, we can still end up with large compactions. Therefore, it might also be a good idea to do things like creating files with only range tombstones.
Contributor guide
Assessment
This issue has not been assessed yet.