Skip to content

Commit

Permalink
kvserver: enqueue update check after Campaign()
Browse files Browse the repository at this point in the history
I noticed that TestSplitBurstWithSlowFollower would average only
<10 splits per second even when no lagging replica is introduced (i.e.
the `time.Sleep` commented out). Investigating the raft chatter
suggested that after campaigning, the leaseholder of the right-hand
side would not be processed by its Store for a `Ready` handling cycle
until after ~50ms (the coalesced heartbeat timeout) in the test had
passed, and a similar delay was observed when it was sending out its
votes. Adding a call to `enqueueRaftUpdateCheck` fixes both, we end
up at ~100 splits per second.

Release note: None
  • Loading branch information
tbg committed Apr 22, 2021
1 parent 547e4a8 commit ed47b60
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/kv/kvserver/replica_raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -1536,6 +1536,7 @@ func (r *Replica) maybeCampaignOnWakeLocked(ctx context.Context) {
if err := r.mu.internalRaftGroup.Campaign(); err != nil {
log.VEventf(ctx, 1, "failed to campaign: %s", err)
}
r.store.enqueueRaftUpdateCheck(r.RangeID)
}
}

Expand Down

0 comments on commit ed47b60

Please sign in to comment.