forked from cockroachdb/pebble
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compaction: Invalidate limit when a splitter defers a split suggestion
Currently, it's possible for the nonZeroSeqNumSplitter to "withhold" a compaction split suggestion in such a way that the `limit` variable in the compaction loop is exceeded, only to advise a compaction split at a later point. This is usually not a concern as we just reset `limit` when that compaction split is actually advised, but if the compaction were to run out of keys in this narrow window, we would leave the limit at a non-nil past key, which would violate an invariant in the rangedel fragmenter as it can't truncate range tombstones to a passed key. Similar logic already existed in older iteration of this code, which is in use in the crl-release-20.2 branch. A refactor here introduced this bug. This change allows for a 3-way return value from shouldSplitBefore; in the case where limit has been exceeded, we resort to resetting the limit like before. Will address cockroachdb/cockroach#54284 when this lands in cockroach master.
- Loading branch information
Showing
4 changed files
with
189 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.