Skip to content

Commit

Permalink
Merge pull request #17304 from a-robinson/decomdormant
Browse files Browse the repository at this point in the history
storage: Eagerly GC dormant replicas when decommissioning
  • Loading branch information
a-robinson authored Jul 30, 2017
2 parents 07f8a22 + fed3895 commit 386e566
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/storage/replica_gc_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@ func (rgcq *replicaGCQueue) shouldQueue(
var isCandidate bool
if raftStatus := repl.RaftStatus(); raftStatus != nil {
isCandidate = (raftStatus.SoftState.RaftState == raft.StateCandidate)
} else {
// If a replica doesn't have an active raft group, we should check whether
// we're decommissioning. If so, we should process the replica because it
// has probably already been removed from its raft group but doesn't know it.
// Without this, node decommissioning can stall on such dormant ranges.
if liveness, _ := repl.store.cfg.NodeLiveness.Self(); liveness != nil && liveness.Decommissioning {
return true, replicaGCPriorityDefault
}
}
return replicaGCShouldQueueImpl(now, lastCheck, lastActivity, isCandidate)
}
Expand Down

0 comments on commit 386e566

Please sign in to comment.