Skip to content

Commit c6b2167

Browse files
kvoliwenyihu6
authored andcommitted
kvserver: reset lb splitter on all queue splits
Previously, we'd only reset the load based splitter state when a load based split occurred. This was reasonable in most cases, as the odds of wanting to split for another reason in addition to load is rare but was nevertheless imperfect. As a result, samples could be left around in the load based splitter that didn't conform to the range boundaries post-split. Informs: #144407 Release note: None
1 parent ee29922 commit c6b2167

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/kv/kvserver/split_queue.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,9 @@ func (sq *splitQueue) processAttempt(
302302
return false, errors.Wrapf(err, "unable to split %s at key %q", r, splitKey)
303303
}
304304
sq.metrics.SpanConfigBasedSplitCount.Inc(1)
305+
306+
// Reset the splitter now that the bounds of the range changed.
307+
r.loadBasedSplitter.Reset(sq.store.Clock().PhysicalTime())
305308
return true, nil
306309
}
307310

@@ -327,6 +330,9 @@ func (sq *splitQueue) processAttempt(
327330
return false, err
328331
}
329332
sq.metrics.SizeBasedSplitCount.Inc(1)
333+
334+
// Reset the splitter now that the bounds of the range changed.
335+
r.loadBasedSplitter.Reset(sq.store.Clock().PhysicalTime())
330336
return true, nil
331337
}
332338

0 commit comments

Comments
 (0)