-
Notifications
You must be signed in to change notification settings - Fork 471
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/manifest: narrow Overlaps to exclude RANGEDEL sentinel keys.
When the largest key in a sstable is a range tombstone, the sstable's largest boundary is set to the range deletion sentinel with the tombstone's exclusive end boundary and the maximum sequence number. The range deletion sentinel serves as a marker, indicating that the file's bounds end immediately before the first key with the sentinel's user key. In many places such as growing compactions or determining atomic compaction units, Pebble considers the sentinel as exclusive and avoids unnecessarily including files that share the same user key but only as a sentinel's exclusive end bounary. The `(*manifest.Version).Overlaps` method did not share this logic and only considered user keys. This method is used during compaction picking when finding the initial compaction inputs, for determining in-use key ranges, grandparent files, etc. This change adapts this method to consider a file with a largest user key equal to the search range's start user key nonoverlapping if the file's largest key is a range deletion sentinel. Additionally, Overlaps now takes an exclusiveEnd parameter, indicating whether the end user key provided to Overlaps should similarly be treated as an exclusive bound. This change is expected to reduce write amplification in the presence of range deletions by avoiding unnecessarily pulling in files due to perceived overlap. Additionally, some of these RangeDeletionSentinel comparisons are updated to use a new (*InternalKey).IsExclusiveSentinel helper. With the introduction of range keys, we will have additional exclusive end boundary key kinds.
- Loading branch information
Showing
23 changed files
with
298 additions
and
241 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
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
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
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
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
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.