Skip to content

Commit

Permalink
db: simplify levelIter skipEmptyFileForward
Browse files Browse the repository at this point in the history
Apply a small simplification to levelIter.skipEmptyFileForward's condition for
when to interleave a synthetic boundary. Previously we needed to check whether
a file's largest point key was a range deletion to work around getIter's use of
the rangeDelIterPtr. Now that getIter no longer uses levelIter it's
unnecessary.
  • Loading branch information
jbowens committed Apr 12, 2024
1 parent e766263 commit 1eab9d6
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions level_iter.go
Original file line number Diff line number Diff line change
Expand Up @@ -993,12 +993,7 @@ func (l *levelIter) skipEmptyFileForward() *base.InternalKV {
// tolerate this repeat key and in this case will keep the level at
// the top of the heap and immediately skip the entry, advancing to
// the next file.
//
// TODO(jackson): We should be able to condition this only on
// *l.rangeDelIterPtr != nil, but the getIter retains tombstones
// returned by the rangeDelIter after it's nil'd the ptr.
if l.iterFile.LargestPointKey.Kind() == InternalKeyKindRangeDelete ||
*l.rangeDelIterPtr != nil {
if *l.rangeDelIterPtr != nil {
l.syntheticBoundary = base.MakeInternalKV(l.iterFile.LargestPointKey, nil)
l.largestBoundary = &l.syntheticBoundary
if l.boundaryContext != nil {
Expand Down

0 comments on commit 1eab9d6

Please sign in to comment.