Skip to content

Commit 0affc8d

Browse files
craig[bot]mw5h
andcommitted
Merge #155261
155261: sql: fix early exit from merge index planner r=mw5h a=mw5h The MergeIndexes() method of the IndexBackfillerMergePlanner has a check to see if there are any spans to merge before proceeding with building the plan for the merge. Previously the check for this was checking whether there were any elements in spansToDo, which is allocated to have one entry per source index ID, causing the length check to be vacuously true. The logic probably meant to to check the length of the spans list for each individual source index ID, which this patch puts into place. Epic: none Release note: None Co-authored-by: Matt White <matt.white@cockroachlabs.com>
2 parents 321213f + cd09eda commit 0affc8d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/sql/mvcc_backfiller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func (im *IndexBackfillerMergePlanner) MergeIndexes(
5858
g.Add(sourceIndexSpan)
5959
g.Sub(progress.CompletedSpans[i]...)
6060
spansToDo[i] = g.Slice()
61-
if len(spansToDo) > 0 {
61+
if len(spansToDo[i]) > 0 {
6262
hasToDo = true
6363
}
6464
}

0 commit comments

Comments
 (0)