Skip to content

Commit

Permalink
kvserver: only pause followers when holding active lease
Browse files Browse the repository at this point in the history
If the raft leader is not the leaseholder (which includes the case in
which we just transferred the lease away), leave all followers unpaused.
Otherwise, the leaseholder won't learn that the entries it submitted
were committed which effectively causes range unavailability.

Fixes #84884.

Release note: None
  • Loading branch information
tbg committed Aug 8, 2022
1 parent bc8c25a commit b52a183
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/kv/kvserver/replica_raft_overload.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,15 @@ func (r *Replica) updatePausedFollowersLocked(
return
}

status := r.leaseStatusAtRLocked(ctx, r.Clock().NowAsClockTimestamp())
if !status.IsValid() || status.OwnedBy(r.StoreID()) {
// If we're not the leaseholder (which includes the case in which we just
// transferred the lease away), leave all followers unpaused. Otherwise, the
// leaseholder won't learn that the entries it submitted were committed
// which effectively causes range unavailability.
return
}

// When multiple followers are overloaded, we may not be able to exclude all
// of them from replication traffic due to quorum constraints. We would like
// a given Range to deterministically exclude the same store (chosen
Expand Down

0 comments on commit b52a183

Please sign in to comment.