overlapping endpoint fixes in level compaction picker #2615
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This diff addresses two problems. Both problems cause us to miss scheduling desirable compactions. One side effect is compaction picking can spam logs, as there's no delay after failed attempts to pick compactions.
The code changes are dependent, which is why I solved both problems in a single diff.
ExpandInputsToCleanCut
into the loop insidePickFileToCompact
. This gives two benefits: (1) if it fails, we will try the next-largest file on the same input level; (2) we get the fully-expanded input-level key-range with which we can check for pending compactions in output level.ExpandInputsToCleanCut
insidePickFileToCompact
's to check for compaction conflicts in output level.IsRangeInCompaction
inPickFileToCompact
, asExpandInputsToCleanCut
also correctly handles the case where original output-level files (i.e., ones not pulled in due to user-key overlap) are pending compaction.Test Plan: unit tests for the two problems mentioned