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.
db: track files' pre-zeroing largest sequence numbers
When there exist no keys beneath a compaction's key range, Pebble performs sequence number zeroing. This is an optimization that allows for easier detection of new user keys during iteration. This commit introduces a new FileMetadata field LargestSeqNumAbsolute that provides an upper bound on the sequence numbers of a sstables' keys before they were zeroed. This is useful as a stable upper bound on the recency of an sstable's keys. In this commit we use this new upper bound to provide an alternative solution to the interaction between delete-only compactions and sequence number zeroing. Previously any compaction that zeroed sequence numbers and overlapped a delete-only compaction hint was required to clear the conflicting hints to ensure a delete-only compaction did not accidentally drop a table containing keys more recent than any of the hint's constituent tombstones. This interaction was a bit indirect and subtle. Encoding the pre-zeroing sequence number on the file metadata is more direct, and will allow us to use the sequence number for recency ordering of sstables' keys more generally, including in cockroachdb#2112.
- Loading branch information
Showing
15 changed files
with
215 additions
and
178 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
Oops, something went wrong.