Skip to content

Commit

Permalink
kvserver: allow empty ranges to be merged regardless of QPS
Browse files Browse the repository at this point in the history
I noticed while running some ORM tests that empty ranges never got merged
away. When I manually range them through the queue, I got the report:

```
skipping merge: LHS QPS measurement not yet reliable
```

All of the ranges in question were totally empty. This small
patch seems to fix the problem.

Release note (bug fix): Empty ranges sometimes will now be merged away
regardless of QPS data.
  • Loading branch information
ajwerner committed Dec 21, 2021
1 parent ea6bfb2 commit c4f6ed0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/kv/kvserver/merge_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,13 @@ func (mq *mergeQueue) process(
// merges, the mergeQueue will only consider a merge when it deems the
// maximum qps measurement from both sides to be sufficiently stable and
// reliable, meaning that it was a maximum measurement over some extended
// period of time.
if !lhsQPSOK {
// period of time. However, if the range is empty, we don't care about
// the QPS.
if !lhsQPSOK && lhsStats.LiveBytes > 0 {
log.VEventf(ctx, 2, "skipping merge: LHS QPS measurement not yet reliable")
return false, nil
}
if !rhsQPSOK {
if !rhsQPSOK && rhsStats.LiveBytes > 0 {
log.VEventf(ctx, 2, "skipping merge: RHS QPS measurement not yet reliable")
return false, nil
}
Expand Down

0 comments on commit c4f6ed0

Please sign in to comment.