Skip to content

Commit

Permalink
storage: Tick all replicas, not just unquiesced ones
Browse files Browse the repository at this point in the history
This reverts the main effect of #24956. The supporting infrastructure
is left in place to minimize merge conflicts and to aid in diagnosing
why the maps get out of sync.

Fixes #26257

Release note: None
  • Loading branch information
bdarnell committed May 31, 2018
1 parent 83e98d9 commit 3106615
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/storage/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -3693,16 +3693,15 @@ func (s *Store) raftTickLoop(ctx context.Context) {
case <-ticker.C:
rangeIDs = rangeIDs[:0]

s.unquiescedReplicas.Lock()
for k := range s.unquiescedReplicas.m {
s.mu.replicas.Range(func(k int64, v unsafe.Pointer) bool {
// Why do we bother to ever queue a Replica on the Raft scheduler for
// tick processing? Couldn't we just call Replica.tick() here? Yes, but
// then a single bad/slow Replica can disrupt tick processing for every
// Replica on the store which cascades into Raft elections and more
// disruption.
rangeIDs = append(rangeIDs, k)
}
s.unquiescedReplicas.Unlock()
rangeIDs = append(rangeIDs, roachpb.RangeID(k))
return true
})

s.scheduler.EnqueueRaftTick(rangeIDs...)
s.metrics.RaftTicks.Inc(1)
Expand Down

0 comments on commit 3106615

Please sign in to comment.