db: avoid duplicate range deletion iterator in the level checker#5703
Merged
jbowens merged 1 commit intocockroachdb:masterfrom Jan 14, 2026
Merged
db: avoid duplicate range deletion iterator in the level checker#5703jbowens merged 1 commit intocockroachdb:masterfrom
jbowens merged 1 commit intocockroachdb:masterfrom
Conversation
Member
78f8281 to
6fe7231
Compare
xinhaoz
approved these changes
Jan 14, 2026
Contributor
xinhaoz
left a comment
There was a problem hiding this comment.
@xinhaoz made 1 comment.
Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on @RaduBerinde).
In 1a2a77b we began interleaving the boundaries of range deletions from level iterators. This interleaving avoids stepping away from a table until its range deletions are no longer useful. However, this interleaving required its own range deletion iterator, necessitating opening two separate range deletion iterators into the same block. This commit updates the levelIter implementation to support interleaving range deletions without using a rangeDelIterSetter callback and adds a new getTombstone method that may be used to retrieve the tombstone at the current iterator's position. In this commit we update the level checker to no longer request its own range deletion iterator through rangeDelIterSetter. Instead use the levelIter's getTombstone method to read the current tombstone within each level, avoiding opening the duplicate range deletion iterator. This commit is a subset of the changes in the unmerged PR cockroachdb#3600. Future work will apply the same technique to the merging iterator, allowing ordinary user iterators to avoid the duplicate range deletion iterator too.
6fe7231 to
d8ed793
Compare
jbowens
commented
Jan 14, 2026
Contributor
Author
jbowens
left a comment
There was a problem hiding this comment.
TFTR!
@jbowens made 1 comment.
Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on @RaduBerinde).
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In 1a2a77b we began interleaving the boundaries of range deletions from level iterators. This interleaving avoids stepping away from a table until its range deletions are no longer useful. However, this interleaving required its own range deletion iterator, necessitating opening two separate range deletion iterators into the same block.
This commit updates the levelIter implementation to support interleaving range deletions without using a rangeDelIterSetter callback and adds a new getTombstone method that may be used to retrieve the tombstone at the current iterator's position.
In this commit we update the level checker to no longer request its own range deletion iterator through rangeDelIterSetter. Instead use the levelIter's getTombstone method to read the current tombstone within each level, avoiding opening the duplicate range deletion iterator.
This commit is a subset of the changes in the unmerged PR #3600. Future work will apply the same technique to the merging iterator, allowing ordinary user iterators to avoid the duplicate range deletion iterator too.