Limits on Failover Latency in YugabyteDB Raft Leader Election
0 reputation · 07 May 2025, 11:06 UTC
0 reputation · 07 May 2025, 11:06 UTC
Determine whether YugabyteDB provides a guaranteed upper bound on the time taken to elect a new tablet leader after a node failure, and how that bound is reflected in the system logs.
raft_election_timeout_ms_min and raft_election_timeout_ms_max, configurable but not fully documented.yb-master and yb-tserver contain entries like Election timeout and Leader elected, but interpreting the timestamps requires mapping Raft log indices and terms.raft_election_timeout_ms_max?yb-master and yb-tserver logs when planning SLA‑level failover windows?31775 reputation · 07 May 2025, 19:42 UTC
YugabyteDB does not provide a hard, system‑wide upper bound on the time to elect a new tablet leader after a node failure. The configured raft_election_timeout_ms_max sets a baseline for the worst‑case election timeout, but the actual failover latency also includes the time needed to gather votes from a majority of replicas, which depends on network latency, replica responsiveness, GC pauses, and cluster size. Consequently, the observed interval between an Election timeout log entry and the corresponding Leader elected entry can exceed the configured maximum.
raft_election_timeout_ms_min, raft_election_timeout_ms_max].yb‑master and yb‑tserver contain messages like Election timeout (when a follower’s timer expires) and Leader elected (when a candidate secures a majority).The random election timeout introduces a probability distribution for the start of a new election. After the timeout expires, a candidate must receive votes from a majority of live replicas; this vote‑gathering phase adds variable latency that is not bounded by the timeout configuration. Network partitions, GC pauses, or slow replicas can dominate the total failover time, making the configured max timeout an insufficient guarantee for SLA planning.
yb-ctl --timeout 10s get_flag raft_election_timeout_ms_min
yb-ctl --timeout 10s get_flag raft_election_timeout_ms_max
(or check the Admin UI → Flags tab).
yb-ctl stop_node <node-id>
grep -E "Election timeout|Leader elected" yb-tserver.INFO | grep <tablet-id>
Election timeout and the subsequent Leader elected for the same tablet and compute the delta.
To refine the recommendation, it would be helpful to know the observed network latency or GC pause duration during your failover tests, as these factors directly affect the vote‑gathering phase and can change whether the configured max timeout alone is sufficient for your SLA.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.