You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kvserver: mark replica as unavailable if leaderless for a long time
This commit marks the replica as unavailable in the leaderlessWatcher if
it has been leaderless for a duration above:
`kv.replica_raft.leaderless_unavailable_threshold`. This helps requests
to bail early on unavailable ranges without relying on the replica
circuit breaker to trip. This has multiple benefits:
1) Faster reaction time than the replica circuit breaker: If two nodes
fail (assuming R=3), many ranges will become unavailable. With the
replica circuit breaker, the breaker is tripped on the request path,
causing added delays. However, with this approach, the replica will
basically become unavailable on the tick path (rather than on the
request path).
2) Lighter weight: Instead of relying on the replica circuit breaker
to test the replication pipeline before it marks the range as
available again, this approach relies on the Raft signal to know
when there is a leader again, indicating that the range is
available again.
3) With leader leases, a replica won't propose a lease if it's not
the leader. This means that with leader leases, the replica circuit
breaker might not trip if the range have lost quorum. However, with
this commit, the replica will eventually forget who the leader was,
and eventually the leaderlessWatcher would mark it as unavailable.
Fixes: #139638
Release note: None
0 commit comments