From 3106615e752628fca3d446028ead653c82b6468a Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Thu, 31 May 2018 14:15:45 -0400 Subject: [PATCH] storage: Tick all replicas, not just unquiesced ones 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 --- pkg/storage/store.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/storage/store.go b/pkg/storage/store.go index 6f5371ee9719..8d1593736292 100644 --- a/pkg/storage/store.go +++ b/pkg/storage/store.go @@ -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)