Skip to content

Conversation

@jbowens
Copy link
Collaborator

@jbowens jbowens commented Jan 12, 2026

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.

@jbowens jbowens requested a review from a team as a code owner January 12, 2026 21:26
@jbowens jbowens requested a review from RaduBerinde January 12, 2026 21:26
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@xinhaoz xinhaoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

@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.
Copy link
Collaborator Author

@jbowens jbowens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TFTR!

@jbowens made 1 comment.
Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on @RaduBerinde).

@jbowens jbowens merged commit d46b095 into cockroachdb:master Jan 14, 2026
9 checks passed
@jbowens jbowens deleted the rdel-levelchecker branch January 14, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants