Skip to content

Commit 703ca0d

Browse files
committed
pebble: delete redundant l0 case in pickAutoLPositive
We should never have l0 as the start level in pickAutoLPositive.
1 parent 6d0d3c1 commit 703ca0d

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

compaction_picker.go

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,8 @@ func (pc *pickedCompaction) setupInputs(
503503
return true
504504
}
505505

506-
// grow grows the number of inputs at c.level without changing the number of
507-
// c.level+1 files in the compaction, and returns whether the inputs grew. sm
506+
// grow grows the number of inputs at startLevel without changing the number of
507+
// pc.outputLevel files in the compaction, and returns whether the inputs grew. sm
508508
// and la are the smallest and largest InternalKeys in all of the inputs.
509509
func (pc *pickedCompaction) grow(
510510
sm, la InternalKey,
@@ -1703,15 +1703,6 @@ func pickAutoLPositive(
17031703
panic("pebble: compaction picked unexpected output level")
17041704
}
17051705
pc.startLevel.files = cInfo.file.Slice()
1706-
// Files in level 0 may overlap each other, so pick up all overlapping ones.
1707-
if pc.startLevel.level == 0 {
1708-
cmp := opts.Comparer.Compare
1709-
smallest, largest := manifest.KeyRange(cmp, pc.startLevel.files.All())
1710-
pc.startLevel.files = vers.Overlaps(0, base.UserKeyBoundsFromInternal(smallest, largest))
1711-
if pc.startLevel.files.Empty() {
1712-
panic("pebble: empty compaction")
1713-
}
1714-
}
17151706

17161707
if !pc.setupInputs(opts, env.diskAvailBytes, pc.startLevel, env.problemSpans) {
17171708
return nil

0 commit comments

Comments
 (0)