Skip to content

Commit 28f801e

Browse files
committed
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 4f779ed commit 28f801e

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
@@ -303,6 +303,9 @@ func (sq *splitQueue) processAttempt(
303303
return false, errors.Wrapf(err, "unable to split %s at key %q", r, splitKey)
304304
}
305305
sq.metrics.SpanConfigBasedSplitCount.Inc(1)
306+
307+
// Reset the splitter now that the bounds of the range changed.
308+
r.loadBasedSplitter.Reset(sq.store.Clock().PhysicalTime())
306309
return true, nil
307310
}
308311

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

0 commit comments

Comments
 (0)