Skip to content

Commit

Permalink
kv: clean up unquiescedReplicas insertion in addReplicaToRangeMapLocked
Browse files Browse the repository at this point in the history
Refactor that does not change behavior.
  • Loading branch information
nvanbenschoten committed Jan 10, 2022
1 parent 376f550 commit ba6f354
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/kv/kvserver/store_create_replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,11 @@ func (s *Store) addReplicaToRangeMapLocked(repl *Replica) error {
// can happen during splits and merges, where the uninitialized (but
// also unquiesced) replica is removed from the unquiesced replica
// map in advance of this method being called.
s.unquiescedReplicas.Lock()
if _, ok := s.unquiescedReplicas.m[repl.RangeID]; !repl.mu.quiescent && !ok {
if !repl.mu.quiescent {
s.unquiescedReplicas.Lock()
s.unquiescedReplicas.m[repl.RangeID] = struct{}{}
s.unquiescedReplicas.Unlock()
}
s.unquiescedReplicas.Unlock()
return nil
}

Expand Down

0 comments on commit ba6f354

Please sign in to comment.