From 84c137ee37feee458a6df39b0e3ece02e4759ad5 Mon Sep 17 00:00:00 2001 From: Andrei Matei Date: Wed, 24 Feb 2021 17:02:38 -0500 Subject: [PATCH] kvserver: plumb a ctx Release note: None --- pkg/kv/kvserver/store_create_replica.go | 2 +- pkg/kv/kvserver/store_remove_replica.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/kv/kvserver/store_create_replica.go b/pkg/kv/kvserver/store_create_replica.go index 8c30e310824b..d7e3510c8474 100644 --- a/pkg/kv/kvserver/store_create_replica.go +++ b/pkg/kv/kvserver/store_create_replica.go @@ -225,7 +225,7 @@ func (s *Store) tryGetOrCreateReplica( repl.mu.destroyStatus.Set(errors.Wrapf(err, "%s: failed to initialize", repl), destroyReasonRemoved) repl.mu.Unlock() s.mu.Lock() - s.unlinkReplicaByRangeIDLocked(rangeID) + s.unlinkReplicaByRangeIDLocked(ctx, rangeID) s.mu.Unlock() repl.raftMu.Unlock() return nil, false, err diff --git a/pkg/kv/kvserver/store_remove_replica.go b/pkg/kv/kvserver/store_remove_replica.go index 0c880193401d..653378af2f4d 100644 --- a/pkg/kv/kvserver/store_remove_replica.go +++ b/pkg/kv/kvserver/store_remove_replica.go @@ -160,7 +160,7 @@ func (s *Store) removeInitializedReplicaRaftMuLocked( s.mu.Lock() defer s.mu.Unlock() - s.unlinkReplicaByRangeIDLocked(rep.RangeID) + s.unlinkReplicaByRangeIDLocked(ctx, rep.RangeID) if it := s.mu.replicasByKey.DeleteReplica(ctx, rep); it.repl != rep { // We already checked that our replica was present in replicasByKey // above. Nothing should have been able to change that. @@ -239,7 +239,7 @@ func (s *Store) removeUninitializedReplicaRaftMuLocked( if s.removePlaceholderLocked(ctx, rep.RangeID) { atomic.AddInt32(&s.counts.droppedPlaceholders, 1) } - s.unlinkReplicaByRangeIDLocked(rep.RangeID) + s.unlinkReplicaByRangeIDLocked(ctx, rep.RangeID) } // unlinkReplicaByRangeIDLocked removes all of the store's references to the @@ -247,7 +247,7 @@ func (s *Store) removeUninitializedReplicaRaftMuLocked( // to be removed from the replicasByKey map. // // store.mu must be held. -func (s *Store) unlinkReplicaByRangeIDLocked(rangeID roachpb.RangeID) { +func (s *Store) unlinkReplicaByRangeIDLocked(ctx context.Context, rangeID roachpb.RangeID) { s.mu.AssertHeld() s.unquiescedReplicas.Lock() delete(s.unquiescedReplicas.m, rangeID)