t.d
← the shelf

LLM paper · No. 04

Raft in Production

From the paper to etcd: leader election, log replication, and everything the paper leaves out.

Written by an LLM on a weekly routine, from public sources — docs, papers, source code and engineering blogs, cited inline. Good for building a mental map; check the sources before relying on a detail.

Introduction: The Paper Is the Easy Part

Raft was designed to be understood. Its authors set understandability as the main goal, split the problem into leader election, log replication and safety, and cut the number of states a server can be in; in a study with 43 students, most answered questions about Raft better than questions about Paxos.1 That goal was met so well that the short version of the algorithm fits on one page of the paper, and the Raft website keeps a long list of open-source implementations.2

The one-page summary is also where the trouble starts. It describes a leader that never pauses, disks that never lie, a network that either delivers a message or drops it, a cluster whose members never change, and a log that grows forever. The paper and Diego Ongaro's dissertation do cover what happens when those assumptions go away, but they do it in later chapters, in prose, often as options: membership changes, log compaction, client sessions, read-only queries, leadership transfer, Pre-Vote.1, 3 A production system needs all of them at once, and it needs them to compose.

This is not a new complaint. The engineers who built Chubby on Paxos wrote in 2007 that there were "significant gaps between the description of the Paxos algorithm and the needs of a real-world system", and that after the necessary extensions "the final system will be based on an unproven protocol".4 Raft narrowed that gap by specifying far more of the system, but it did not close it. The etcd Raft library lists eight optional enhancements on top of its core features, and its documentation states one place where it deliberately departs from the dissertation.5

This paper follows a write and a read through a Raft cluster and stops at each place where the paper's version is not enough. The two running examples are the libraries most Go systems are built on: etcd-io/raft, which powers etcd, Kubernetes, CockroachDB and TiDB, and hashicorp/raft, which powers Consul.5, 6

Section 1: The Core Protocol and What It Assumes

1.1 A replicated log with one writer

Raft implements a replicated state machine: every server holds a log of commands, applies them in the same order to a deterministic state machine, and so reaches the same state. Consensus is the job of keeping those logs identical. A cluster keeps working while a majority of its servers are up and can talk to each other, so five servers tolerate two failures.1, 2

Raft's main simplification is a strong leader. One server at a time accepts client commands, appends them to its log and tells the others what to append. Entries flow in one direction only, from the leader to followers.1 That removes most of the cases a symmetric protocol has to consider, and it moves the hard question to a single place: what happens when the leader changes.

1.2 Terms and elections

Time is divided into terms, numbered with consecutive integers. Each term starts with an election and has at most one leader. Every message carries the sender's term. A server that sees a larger term adopts it, and a leader or candidate that sees a larger term steps down to follower; a server that receives a request with a stale term rejects it.3 The term works as a logical clock that lets servers detect stale leaders without any shared notion of real time.

A follower that hears nothing from a leader for an election timeout increments its term, votes for itself and sends RequestVote to the others. A server grants at most one vote per term, so two candidates cannot both collect a majority in the same term. To keep candidates from splitting the vote forever, each server picks its timeout at random from a range; the paper suggests 150 to 300 ms.1 In the paper's tests, elections with no randomness regularly took more than ten seconds because of split votes, and 5 ms of spread brought the median downtime to 287 ms.1

1.3 Replication and the consistency check

The leader sends new entries with AppendEntries. Each request names the index and term of the entry that comes just before the new ones. A follower that has no matching entry at that position refuses, and the leader backs up and retries with an earlier position until the logs agree, after which the follower deletes anything that conflicts and appends the leader's entries.1 This single check gives the Log Matching property: if two logs hold an entry with the same index and term, they are identical up to that entry. The leader tracks a nextIndex and matchIndex for each follower, and an entry is committed once it is stored on a majority. Heartbeats are AppendEntries requests that carry no entries.1 A common implementation mistake is to treat them as a separate, simpler message and skip the consistency check, which undermines the acknowledgements the leader counts when it commits.7

1.4 The two rules that make it safe

Two restrictions carry the safety argument. The first is on voting: a server refuses its vote to a candidate whose log is less up to date than its own, comparing the term of the last entry and then the length.1 Any committed entry is on a majority, any winning candidate got votes from a majority, the two majorities share a server, and that server would not have voted for a candidate missing the entry. So a new leader already holds every committed entry, and nothing needs to be copied to it. This is the Leader Completeness property.1

The second is on commitment: a leader only counts replicas to commit entries from its own term. An entry from an older term can sit on a majority and still be overwritten by a later leader, as the paper's Figure 8 shows, so older entries are committed indirectly, when a current-term entry after them commits.1 The practical consequence is that a new leader does not know its own commit index until it has committed something. Raft has each leader append a blank no-op entry at the start of its term for that reason.1 Skipping either half of this rule is a recurring bug: it appears in the list of mistakes made by students implementing Raft for MIT's course, and in production code, as Section 6 shows.7

1.5 The assumption underneath: stable storage

Three things must survive a restart: the current term, the vote cast in that term and the log. The paper's summary says they are "updated on stable storage before responding to RPCs".1 Everything else is rebuilt. This is the assumption the proof leans on hardest. A server that forgets its vote can vote twice in a term. A server that acknowledged an entry and then lost it may have been part of the majority that made the entry committed.

"Stable" means an fsync that returned, on a disk that does what it reports. Section 5 covers what happens when a system relaxes that: Jepsen's 2025 analysis of NATS JetStream, which by default flushed to disk every two minutes while acknowledging writes immediately, lost 131,418 of 930,005 acknowledged messages in a simulated power failure.8

Section 2: Elections in Production

2.1 The timers people actually run

Raft needs one timing relationship to stay live: broadcastTime ≪ electionTimeout ≪ MTBF. The time to send a round of RPCs and get answers, including the disk write on each follower, must be well under the election timeout, and the timeout must be well under the time between server failures.1 The paper suggests 150 to 300 ms. Deployed systems are more conservative, because a spurious election costs more than a slow one.

SystemHeartbeatElection timeoutNotes
Raft papernot fixed150–300 ms, randomisedsuggested starting point
etcd v3.6--heartbeat-interval 100 ms--election-timeout 1,000 mstimeout must be at least 5× the heartbeat; capped at 50 s
hashicorp/raftderived from the timeoutHeartbeatTimeout 1,000 ms, ElectionTimeout 1,000 mseach timer fires between 1× and 2× its value
Consulthe library values × raft_multiplier (default 5, so 5 s)set the multiplier to 1 on production hardware
TiKV2 ticks of 1 s10 ticks of 1 sone Raft group per Region

The etcd figures come from its tuning guide and flag validation; the guide recommends a heartbeat of roughly 0.5 to 1.5 times the round-trip time between members and an election timeout of at least ten times the round trip.9, 10, 11 The etcd library itself counts in abstract ticks and suggests ElectionTick = 10 * HeartbeatTick.12 The HashiCorp values are from DefaultConfig(), and its randomTimeout helper returns a value between the configured duration and twice that.13, 14 Consul's default multiplier is 5.15 TiKV, which runs one Raft group per Region, uses one-second ticks: a heartbeat every two and an election after ten.16

The practical rule is that the election timeout is a failure detector, and its false-positive rate is set by the slowest thing in the heartbeat path. For etcd that is usually the disk: the leader may have to persist metadata before a heartbeat goes out, and the FAQ asks for a 99th-percentile WAL fsync under 10 ms.17

2.2 The server that comes back

Consider a follower cut off from the cluster. It hears no heartbeats, times out, increments its term and asks for votes that nobody receives. It does this again and again. When the network heals, its term is far ahead of everyone else's. The first message it exchanges with the cluster carries that term, and the term rule from Section 1.2 forces the healthy leader to step down. The returning server cannot win the election that follows, because its log is behind, but the cluster still has to stop and hold an election.3

The dissertation's fix is Pre-Vote. Before incrementing its term, a would-be candidate asks the others whether they would vote for it. A server says yes only if the candidate's log is sufficiently up to date and it has not itself heard from a valid leader within an election timeout. Only a candidate with a majority of yes answers increments its term and runs a real election.3 A partitioned server can never collect that majority, so its term stays put, and when it reconnects it rejoins as a follower in the current term.

Both libraries implement it. In etcd-io/raft it is Config.PreVote, using MsgPreVote messages; the etcd server exposes it as --pre-vote, which defaults to true in v3.6.12, 10 hashicorp/raft added it in v1.7.0 (June 2024), on by default, with PreVoteDisabled to turn it off.18, 13 The merged design uses a separate RequestPreVote RPC so that older servers never mistake a pre-vote for a real one, and a candidate counts an "unknown command" error from an old peer as a grant so that a half-upgraded cluster cannot stall.19

2.3 Check-quorum and the sticky leader

Pre-Vote handles a follower that cannot hear the leader. The mirror image is a leader that cannot hear its followers. In the basic protocol such a leader stays leader until a message with a higher term reaches it. It cannot commit anything, but it keeps accepting proposals and, as Section 3 shows, may answer reads.

Check-quorum makes the leader police itself. In etcd-io/raft, with Config.CheckQuorum set, the leader checks once per election timeout whether it has heard from a quorum and steps down if it has not.12 hashicorp/raft calls the same idea LeaderLeaseTimeout, 500 ms by default: a leader that goes that long without contacting a quorum steps down. Validation forbids setting it above HeartbeatTimeout.13, 20

The dissertation adds a third piece, from its chapter on membership: a server that receives RequestVote within the minimum election timeout of hearing from a leader "does not update its term or grant its vote".3 The etcd library applies this whenever check-quorum is on. Its vote handler computes inLease := r.checkQuorum && r.lead != None && r.electionElapsed < r.electionTimeout and ignores the request if the lease holds.12 hashicorp/raft does it unconditionally, logging "rejecting vote request since we have a leader".20 Leadership transfer has to pierce this protection, so both libraries mark transfer-triggered vote requests with a flag that the check lets through.12, 20

2.4 Why both are needed: the Cloudflare incident

On 2 November 2020 a switch in a Cloudflare data centre failed partially. For about six minutes, one member of a three-node etcd cluster could not reach the leader but could still reach the third node.21

          node 1  ----X----  node 3 (leader)
             \                 /
              \               /
               +--- node 2 --+

  node 1: hears no heartbeats, keeps starting elections
  node 2: reachable from both, keeps siding with node 3
  node 3: leader when the fault began; no stable leader afterwards

Cloudflare reports that node 1 kept starting elections and no stable leader emerged, so the cluster could not accept writes until the switch recovered. Database failover automation that depended on etcd reacted badly, and the API and dashboard were degraded for six hours and 33 minutes.21 The post called the failure Byzantine; a postscript notes that others classify it as an omission fault, which Raft is supposed to tolerate.21

Heidi Howard and Ittai Abraham worked through what the incident implies. With plain Raft, a server that can reach only part of the cluster keeps raising its term and deposing whoever leads, so "this system will not be able to establish a stable leader". Pre-Vote fixes that case. But Pre-Vote alone creates a different one: a leader that has lost its majority but still reaches one follower keeps that follower from granting pre-votes to anyone else, and the cluster stalls with a leader that cannot commit. Check-quorum fixes that by making the stranded leader step down. Their conclusion is that Raft needs both extensions to keep a stable leader under partial partitions.22

This is why etcd's server hard-codes CheckQuorum: true and takes Pre-Vote from a flag that now defaults to on.23, 10 The Cloudflare post does not say which etcd version or settings its cluster ran.21

2.5 Handing leadership over on purpose

Planned restarts should not cost an election timeout. In the leadership transfer extension the leader stops accepting new requests, brings the target's log fully up to date, then sends it TimeoutNow, which makes the target start an election immediately. Because nobody else is close to timing out, it almost always wins.3 hashicorp/raft exposes this as LeadershipTransfer(), and etcd-io/raft as the MsgTransferLeader and MsgTimeoutNow messages; in etcd's library a transfer that has not completed within an election timeout is abandoned and the old leader resumes.24, 12

Section 3: Linearizable Reads

3.1 A leader cannot trust itself

Writes are safe by construction: an entry is acknowledged only after a majority stores it. Reads are where implementations first went wrong. The obvious way to serve one is for the leader to answer from its own state machine. But "leader" is a belief a server holds about itself. Raft guarantees one leader per term, and nothing stops a server from still believing it leads term 4 while the rest of the cluster has elected someone for term 5 and committed new writes. A read answered by the old leader returns a value that has already been overwritten.

In April 2014 Kyle Kingsbury filed etcd issue #741, "Consistent reads are not consistent": with a partition it was possible to write "foo", write "bar", then read "foo".25 His Jepsen write-up that June found the same behaviour in Consul. In both, a node that considered itself leader returned local state without checking with anyone.26 etcd responded with a quorum=true read option that sent GETs through Raft, and Consul with three read modes that it still has today.25, 26 The dissertation, finished the same year, notes that stale reads had "already been discovered in two third-party Raft implementations".3

The always-correct answer is to put the read in the log like a write. It then commits at a definite position, and whichever server answers does so after applying everything before it. The cost is a disk write and a replication round per read, for an operation that changes nothing.

3.2 ReadIndex: confirm leadership, skip the disk

The dissertation's procedure keeps the guarantee and drops the log write. The leader:3

  1. makes sure it has committed an entry from its current term (the no-op from Section 1.4), so that its commit index is trustworthy;
  2. records the current commit index as the readIndex;
  3. sends a round of heartbeats and waits for a majority to acknowledge, which proves that no newer leader existed at the moment the heartbeats were sent;
  4. waits until its state machine has applied at least up to readIndex;
  5. runs the query and replies.

One heartbeat round can cover every read that queued up while it was in flight, so the cost per read falls as load rises.3 In etcd-io/raft this is the default mode, ReadOnlySafe. The application calls ReadIndex with an opaque request id; the library attaches the id to its heartbeats, counts acknowledgements, and hands back a ReadState holding the index once a quorum has answered.12, 27 Step 1 is enforced in code: a leader that has not committed an entry in its term postpones MsgReadIndex requests until it has.12 Step 4 belongs to the application, and forgetting it produces a read that is linearizable on paper and stale in practice.

Followers can use the same mechanism. A follower asks the leader for a read index, waits until its own state machine reaches it, and answers locally; the etcd library forwards MsgReadIndex to the leader for this purpose.3, 12

3.3 Leases: trade the round trip for a clock assumption

ReadIndex still costs a network round trip per batch of reads. The alternative is a lease. Once a majority acknowledges a heartbeat sent at time start, the leader knows that those followers will not time out, and so no other leader can be elected, for about one election timeout. It can answer reads from local state until start + electionTimeout / clockDriftBound without talking to anyone.3

 leader    |--hb sent-->        <--majority acks--|
           start                                  lease valid until
           |                                      start + electionTimeout / drift
           |=========== reads served locally ==========|
 follower           |--- will not vote for anyone else ---------|
                    last heard from leader      + electionTimeout

The safety of this rests on bounded clock drift between servers, and the dissertation is blunt about it: scheduling and garbage-collection pauses, virtual machine migration and clock rate adjustments can all violate the bound, in which case "the system could return arbitrarily stale information". LogCabin did not implement leases, and the text recommends against them "unless necessary to meet performance requirements".3 The etcd library carries the same warning on ReadOnlyLeaseBased, says the mode "can be affected by clock drift", and requires CheckQuorum to be on, because a lease only means something if followers also refuse to vote while it is valid (Section 2.3).12

A lease also has a cost on failover. A new leader must not serve lease reads, and in designs where the lease also gates writes must not do anything, until the old lease has certainly expired. The lease length therefore sits directly inside the worst-case unavailability after a leader failure.

3.4 What each system chose

SystemDefault readMechanismAlternative
etcd v3linearizablegoes through the consensus processserializable requests read one member's local state
Consuldefault: leader's local stateno per-read check; brief stale window around a leader changeconsistent verifies with a quorum; stale lets any server answer
TiKVlease read9 s lease against a 10 s election timeout, on a monotonic raw clockReadIndex (a heartbeat round)
CockroachDBleaseholder readleader leases backed by store livenessfollower reads on non-voting replicas

etcd documents strict serializability for its KV API and says linearized requests "must go through the Raft consensus process"; the serializable option trades that for latency and may return stale data.28 Jepsen's 2020 analysis of etcd 3.4.3 confirmed the claim under partitions, pauses, crashes, clock skew and membership changes. The problems it did find were above Raft, in the lock API.29

Consul's default mode is described as "strongly consistent in almost all cases", with a window during leader election in which an old leader may answer. consistent mode "requires that a leader verify with a quorum of peers that it is still leader", at the cost of a round trip, and stale results are "generally consistent to within 50 milliseconds of the leader".30 In the library the verification is VerifyLeader(), whose doc comment says it exists "to prevent returning stale data from the FSM after the peer has lost leadership"; Barrier() is its companion for step 4, blocking until all preceding entries have been applied.24

TiKV shows what a careful lease looks like. The lease is renewed by writes: when a write is proposed, the leader records the time, and when that write is applied the lease extends from the recorded time. Its maximum is fixed at 9 seconds against a default 10-second election timeout, so an old leader's lease runs out before a successor can be elected. It reads CLOCK_MONOTONIC_RAW, because the ordinary monotonic clock's rate can be adjusted by NTP.31, 16

CockroachDB separates the concept further. Each range has a leaseholder, the only replica that serves reads or proposes writes, and it serves reads "without going through Raft". In current versions the lease is tied to Raft leadership: a replica can become leader only if a quorum of stores "fortify" it through a store-level heartbeat mechanism, and it keeps the lease for as long as that support lasts.32

3.5 Exactly-once is a separate problem

Linearizability also needs each command to take effect once. A client whose request times out cannot tell whether it committed; if it retries and both attempts are in the log, the command runs twice. The dissertation's answer is sessions: each client gets an id and numbers its commands, and the state machine remembers the last serial number and response per client so that a duplicate returns the stored answer.3

Neither library does this for you. hashicorp/raft documents that when Apply returns ErrLeadershipLost "there is no way to guarantee whether the write succeeded or failed".24 Jepsen's 2024 analysis of jetcd, etcd's Java client, found that the client automatically retried requests that might already have executed, producing lost updates and transactions that observed their own earlier execution. The servers behaved correctly; they executed each request they were sent.33 Deduplication has to be designed into the state machine or the request (conditional writes, idempotency keys), because consensus only orders what it is given.

Section 4: Changing the Membership

4.1 Why it is dangerous, and joint consensus

Every safety argument so far depends on any two majorities sharing a server. A configuration change alters what "majority" means, and servers learn of the change at different times. Grow a cluster from three to five by simply telling everyone, and for a moment two of the old three can form a majority under the old configuration while three servers that already know the new one form a majority under it. Two leaders can be elected in the same term.1, 3

The paper's solution is joint consensus, a two-step change through a transitional configuration Cold,new in which every decision, elections and commitment alike, needs a majority of the old servers and, separately, a majority of the new servers. The leader first replicates Cold,new as a log entry, then Cnew.1

C old majority of old C old,new (joint) majority of old AND new C new majority of new joint entry appended C new entry appended Who must agree before anything is decided
Figure 1. Joint consensus. At no point can the old majority and the new majority decide independently: the joint phase requires both.

Two details matter later. In the paper a server uses a configuration as soon as the entry is in its log, without waiting for it to commit. And the change can be arbitrary: any set of servers can be swapped for any other in one operation.1

4.2 One server at a time, and the bug in it

The dissertation replaced joint consensus with something simpler as the default. If only one server is added or removed at a time, every majority of the old configuration overlaps every majority of the new one, so the cluster can switch directly with a single Cnew entry and no joint phase. Larger changes become a sequence of single-server steps.3

In July 2015, a year after the dissertation, Ongaro posted "bug in single-server membership changes" to the raft-dev list. Huanchen Zhang and Brandon Amos, formalising the algorithm for a class project at CMU, had found a counterexample by hand.34 The overlap argument assumes each change starts from the previous one. Two leaders in different terms can each start a different change from the same base, and the two resulting configurations need not overlap:

 C = {S1,S2,S3,S4}      D = C + S5      E = C - S1

 term 1  S1 is leader. Appends D, replicates it only to S5, goes offline.
         S1: [C, D]   S5: [C, D]   S2, S3, S4: [C]

 term 2  S2 wins with votes from S2, S3, S4 (a majority of C).
         Appends E, replicates it to S3. Majority of E = 2 of {S2,S3,S4}.
         E is committed.   S2, S3: [C, E]   S4: [C]

 term 3  S1 returns and wins with votes from S1, S4, S5 (a majority of D).
         S1 never saw E. It replicates D over it.
         A committed entry is lost.

A quorum of D (S1, S4, S5) and a quorum of E (S2, S3) share no server. The fix is one extra rule: "a leader may not append a new configuration entry until it has committed an entry from its current term". Committing the no-op first forces the new leader to discover, and finish or overwrite, any change its predecessor left half done. Joint consensus is not affected, because two competing joint configurations always share the old configuration.34

Two things are worth remembering. The broken algorithm was in a dissertation that came with a safety proof; the proof covered the core protocol, not membership changes. And each implementer still has to carry the fix by hand: Kafka's KIP-853, which adds dynamic membership to KRaft using single-voter changes, cites the bug by name as the reason its leader must commit in its current epoch before accepting a change.35

4.3 Learners: catch up before you count

A new server starts with an empty log. If it becomes a voter immediately, a three-server cluster becomes a four-server cluster with quorum three, and one of those four has nothing. Lose one original member while the newcomer is still copying and the cluster cannot commit.3 The dissertation adds a phase before the change in which the new server is a non-voting member: it receives the log but is not counted in majorities, and is promoted once it has caught up.3

etcd shipped this in v3.4 as learners, and its design document lists the failures that motivated it: a new member's catch-up traffic overloading the leader until heartbeats are late; a 2+2 partition right after an add; and a member added with the wrong peer URL, which raises the quorum size for a node that can never start.36 The workflow is etcdctl member add --learner, then member promote, which the server rejects until the learner's log has caught up with the leader's. Learners do not serve reads or writes, cannot receive leadership, and are limited in number by --max-learners.36, 11

hashicorp/raft's version came from a redesign Ongaro co-wrote for the library. A server is a Voter, a Nonvoter or Staging; AddVoter() adds the server as staging and the leader promotes it once it is ready, while AddNonvoter() adds a permanent non-voting replica.37, 24 CockroachDB does the same for every range rebalance: a new replica is added as a learner, receives a snapshot, and is promoted in a later step.38

4.4 etcd-io/raft: configurations take effect on apply

etcd's library departs from the dissertation in one stated way: "the membership change takes effect when its entry is applied, not when it is added to the log".5 Cockroach Labs' Tobias Grieger put it more sharply while extending the library: in this respect "etcd/raft doesn't actually really implement the Raft consensus algorithm".39 The entry is therefore committed under the old configuration, and the library keeps the one-at-a-time invariant by tracking a pendingConfIndex and refusing to propose a configuration change while an earlier one may be unapplied. A node also refuses to campaign while it has committed but unapplied configuration changes.12

Single-server changes turned out not to be enough. CockroachDB keeps one replica of a range in each of three regions. Moving a replica to another node in the same region by add-then-remove passes through a four-replica configuration with two replicas in one region; lose that region and the range loses quorum. For its 19.2 release the team implemented joint consensus in etcd's library, across 22 pull requests, to make the swap atomic.39 The API is ConfChangeV2, which carries a list of changes and a transition mode; the library's joint quorum is literally two majority configurations whose commit index is the smaller of the two and whose vote succeeds only if both succeed.40, 41, 42

4.5 Removed servers and removed leaders

A server that has been removed stops receiving heartbeats, and it may never have received the entry that removed it. From its point of view the leader has died, so it starts elections. The dissertation observes that Pre-Vote does not help here: the removed server's log can be as up to date as anyone's. The lease rule from Section 2.3 is the fix, since servers that are hearing from a leader ignore the vote request.3 A comment in etcd's code describes the same mechanism and the purpose: to minimise disruption from nodes that have been removed from the configuration.12

A leader asked to remove itself either transfers leadership first or commits the change and then steps down.3 In etcd-io/raft stepping down on removal is still opt-in through StepDownOnRemoval, which the source says will become unconditional.12

4.6 Rules for operators

The protocol only protects changes that go through it. etcd's documentation turns that into operating rules. To replace a failed member, remove it first and then add the replacement, because adding first raises the quorum while a member is already down. --strict-reconfig-check, on by default, rejects changes that would lose quorum.36, 10 If a majority is permanently lost, etcd will not let you force-remove the dead members from the survivors, because that bypasses consensus and can produce two diverged clusters with the same cluster ID; recovery means starting a new cluster from a surviving data directory.43

Identity is part of this. The etcd library requires that a node ID is never reused.5 Jepsen's 2016 analysis of RethinkDB shows why: a removed replica that was re-added could come back under its old Raft identity with its storage wiped, cast again votes it had already cast, and so allow "two leaders to win the election for a single term". The result was split brain and lost writes, from a system that used textbook joint consensus underneath.44

Section 5: The Log in Practice

5.1 Snapshots replace a prefix of the log

A log that only grows eventually fills the disk and makes restarts and catch-up slower every day. Raft's compaction is snapshotting: each server, independently, serialises its state machine as of some committed index, records the index and term of the last entry the snapshot covers along with the configuration in force, and discards the log up to that point.1

The leader still needs a way to help a follower that needs entries the leader has already thrown away, such as a new server or one that was down for a long time. It sends its snapshot with InstallSnapshot, in chunks, and the follower replaces its state with it.1

5.2 When to snapshot and how much log to keep

Two numbers control the behaviour, and the second matters more than it looks.

Snapshot triggerLog kept after a snapshot
etcd v3.6--snapshot-count: 10,000 applied entriessnapshot-catchup-entries: 5,000
hashicorp/raftSnapshotThreshold: 8,192 entries, checked every SnapshotInterval (120 s, staggered)TrailingLogs: 10,240

The trailing entries exist for followers. If the leader truncated its log exactly at the snapshot index, any follower even one entry behind would need the whole snapshot. Keeping a tail lets a follower that is slightly behind catch up from the log. The comment on etcd's default explains the sizing: followers are expected to lag by milliseconds, peak throughput is around 10,000 entries per second, so 5,000 entries is enough slack.45, 13 The trigger is a memory trade as well. etcd lowered the default --snapshot-count from 100,000 in v3.5 to 10,000 in v3.6, so that it retains about a tenth of the history it used to, and the release announcement credits this with most of a drop of at least 50% in average memory use.46

On the HashiCorp side the constraint is in the FSM contract. FSM.Snapshot() is called on the same thread as Apply and "should return quickly", capturing only a pointer to the state, while the expensive write happens in FSMSnapshot.Persist, concurrently with new applies.47 That forces the state machine to be something you can snapshot cheaply at a point in time; Consul's in-memory database, MemDB, lets it keep accepting transactions while a snapshot is captured.48

5.3 Tracking each follower: probe, replicate, snapshot

The paper's leader keeps a nextIndex per follower and retries forever. A production leader has to distinguish a follower that is keeping up, one whose position it does not know, and one that is too far gone, because the right behaviour differs for each. etcd-io/raft makes this an explicit state machine per follower, called Progress:49, 50

                 first successful ack
   +------------+ -----------------------> +----------------+
   | StateProbe |                          | StateReplicate |
   | one append |  <---------------------- | optimistic     |
   | at a time  |   rejection, or peer     | pipelining,    |
   +------------+   reported unreachable   | bounded window |
      ^      |                             +----------------+
      |      | needed entries are                   |
      |      v already compacted                    |
   +---------------+                                |
   | StateSnapshot | <------------------------------+
   | send snapshot,|
   | pause appends |
   +---------------+
     snapshot applied or failed: back to StateProbe

In StateProbe the leader does not know the follower's last index, so it sends one append and waits; the rejection carries a hint that normally lets it find the right position in one round. In StateReplicate it advances Next as soon as a message is sent, without waiting for the acknowledgement, which is the pipelining described in the dissertation.49, 3 A rejection, or a MsgUnreachable report from the transport, sends the follower back to probing. If the entries it needs are gone, the leader moves it to StateSnapshot, sends a MsgSnap, and stops sending appends until the application reports the outcome with ReportSnapshot().51, 50

The window in the replicate state is the library's flow control. MaxSizePerMsg caps the bytes in one append, MaxInflightMsgs caps the number of unacknowledged appends, and MaxInflightBytes caps their total size; a follower at the limit is paused until an acknowledgement frees quota.12, 52 The source spells out the trade: with a 1 MB in-flight limit and a 100 ms round trip, a group cannot replicate faster than 10 MB/s.12 etcd's server sets 1 MiB per message and 512 in-flight messages; TiKV's defaults are 1 MiB and 256.53, 16 The purpose of all of this is that one slow follower costs the leader bounded memory and does not slow the other followers, since a majority can commit without it.

hashicorp/raft has the same shape with less configuration. Each follower gets a replication goroutine that sends up to MaxAppendEntries (64) entries per RPC; once it is in sync the goroutine switches to a pipelined mode and drops back to request-response on any error; a follower that is too far behind is sent the latest snapshot.13, 54

5.4 Batching, pipelining and the leader's own disk

Throughput comes from amortising the two expensive operations, the fsync and the network round trip, over many entries. AppendEntries carries multiple entries by design, and a follower writes each batch with one sync; LogCabin capped a batch at one megabyte so that a large request could not delay heartbeats.3 hashicorp/raft has a CommitTimeout of 50 ms, after which the leader sends an AppendEntries to followers even if no new command has arrived, and it lets the state machine implement BatchingFSM to apply up to MaxAppendEntries entries per call.13, 47

A less obvious optimisation concerns the leader. The simple implementation has the leader fsync an entry and then send it. The dissertation points out that the leader can write to its own disk in parallel with replicating: it treats itself as one more follower whose match index advances when its own write completes, and an entry can commit on a majority of followers before the leader's disk has it.3 etcd-io/raft lists this among its features, and its contract with the application encodes the ordering rules that keep it safe: messages may be sent while entries from the same batch are still being persisted, but none may be sent until the latest HardState (term, vote, commit) and all entries from earlier batches are durable.5 A vote or an acknowledgement must never leave the machine before the state that justifies it is on disk.

The library's AsyncStorageWrites option takes this further. Log appends and applies become messages to a local append thread and a local apply thread, each carrying the responses to release once the write completes, so that a slow fsync no longer blocks the main loop from handling other messages.12

5.5 Bounding the leader

A leader that has lost its followers but not yet stepped down keeps accepting proposals it cannot commit. MaxUncommittedEntriesSize limits the total size of uncommitted entries in the leader's log; past it, proposals fail with ErrProposalDropped.12 etcd also bounds a single request with --max-request-bytes, 1.5 MiB by default.11

5.6 What "persisted" has to mean

Section 1.5 said the proof assumes stable storage. Consul's documentation states the operational consequence plainly: the log store "performs a sync to disk every time an entry is appended", so write throughput is bounded by disk latency.15 Storage engines for Raft logs are judged largely by how many syncs an append costs; HashiCorp wrote raft-wal as an alternative to its BoltDB-backed log store partly because it needs one fsync per append where BoltDB needs two, and because truncations in BoltDB's B-tree slowed later appends.55

Skipping the sync turns a correlated crash into data loss. Jepsen's NATS analysis walks through the argument: if a majority acknowledges an entry held only in page cache, the entry is committed, and a power failure or a single OS crash combined with a partition can leave a quorum that never saw it.8

Syncing is not sufficient either, because disks return corrupted data and lose files. The FAST 2018 paper on protocol-aware recovery tested how replicated state machines react to a corrupted or unreadable log entry and found that the common local responses are unsafe once consensus is involved. A node that truncates its log at the bad entry, or deletes its data and rejoins empty, is quietly withdrawing acknowledgements that other nodes counted towards commitment. The unmodified versions of LogCabin and ZooKeeper could lose data or become unavailable under such faults.56 The rule that follows is that a replica which knows its log is damaged must not vote or acknowledge as though it merely had a short log. It needs to be repaired from its peers, or replaced as a new member with a new identity (Section 4.6).

5.7 Thousands of groups per node

Systems that shard data run one Raft group per shard, which changes the cost model. CockroachDB noted in 2015 that a node could take part in hundreds of thousands of groups, and that heartbeat traffic would grow with the number of ranges. Its answer was to coalesce heartbeats: each pair of nodes exchanges one heartbeat per tick regardless of how many ranges they share, and a small fixed number of goroutines drives all groups.57 TiKV's equivalent is Hibernate Region, on by default since v5.0.2, which cuts the heartbeat traffic of idle Regions.16 CockroachDB built this on etcd's library, whose abstractions it found easy to adapt to the purpose.57

Section 6: Two Libraries, and How Raft Systems Fail

6.1 etcd-io/raft: a state machine you drive

etcd's library implements only the algorithm. "Both network and disk IO are left to the user", and the core is modelled as a deterministic state machine that takes a message (from a peer or a local timer tick) and outputs messages to send, entries to persist and state changes.5 The application owns the loop:

for {
  select {
  case <-s.Ticker:
    n.Tick()
  case rd := <-s.Node.Ready():
    saveToStorage(rd.HardState, rd.Entries, rd.Snapshot)
    send(rd.Messages)
    if !raft.IsEmptySnap(rd.Snapshot) {
      processSnapshot(rd.Snapshot)
    }
    for _, entry := range rd.CommittedEntries {
      process(entry)
      if entry.GetType() == raftpb.EntryConfChange {
        var cc raftpb.ConfChange
        proto.Unmarshal(entry.GetData(), &cc)
        s.Node.ApplyConfChange(cc)
      }
    }
    s.Node.Advance()
  case <-s.done:
    return
  }
}

This example is from the README.5 Each Ready is a batch of obligations, and the persist-before-send rule from Section 5.4 is the application's to keep. Time is a call to Tick(), so tests can run a cluster with no clocks and no sockets, and the same input always produces the same output. Section 6.5 returns to why that matters.

6.2 hashicorp/raft: bring a state machine and four stores

HashiCorp's library runs the loop itself. The constructor takes a configuration and five things: an FSM, a LogStore, a StableStore, a SnapshotStore and a Transport.24 The application calls Apply(cmd, timeout) on the leader and gets a future; the library replicates, persists, and calls FSM.Apply on every server once the entry is committed.24, 47

etcd-io/rafthashicorp/raft
Shapedeterministic core; caller does I/O, timers, threadscomplete runtime behind interfaces
Timelogical tickswall-clock durations
Pre-Vote / check-quorumPreVote, CheckQuorum (both opt-in in the library)Pre-Vote on by default since v1.7.0; LeaderLeaseTimeout always active
Linearizable readsReadIndex (quorum) or lease-basedVerifyLeader() plus Barrier()
Membershipsingle change or joint consensus; learners; effective on applysingle change; voter, non-voter, staging; effective on append
Flow controlexplicit per-follower states and in-flight limitsper-follower goroutine, pipeline mode, MaxAppendEntries
Good fitmany groups per process, custom storageone group per process, quick to embed

The membership row is a real behavioural difference. HashiCorp's design follows the dissertation: a configuration "will be in affect as soon as it is appended to the log", and each server tracks both its latest and its committed configuration so that it can fall back if the uncommitted one is truncated.37 etcd's applies at commit (Section 4.4). Each is safe with its own guard rails, and the two guards are not interchangeable.

6.3 What Jepsen found

Jepsen's analyses of Raft-based systems form a consistent record. None of the failures below is a flaw in the Raft paper's core algorithm.

System (year)FailureRoot cause
etcd, Consul (2014)stale readsleader answered reads without confirming leadership
RethinkDB 2.2.3 (2016)split brain, lost updates during reconfigurationremoved replica rejoined under its old identity and voted twice
Dgraph 1.0.2 (2018)lost and inconsistent writes, stuck joinsstate machine "not exactly deterministic"; asynchronous apply; leader-change handling
etcd 3.4.3 (2020)none at the KV layerlocks unsafe by nature, documentation errors
Redis-Raft (2020)21 issues: stale reads, lost updates, split brain, crashesno no-op on election; membership entry handling; snapshot and log loading
NATS 2.12.1 (2025)lost acknowledged writes, split brain, deleted streamlazy fsync; mishandled corruption

The sources are the individual reports.26, 44, 58, 29, 59, 8 Redis-Raft is the clearest illustration of Section 1.4. Its Raft library did not append a no-op when a leader was elected, so a new leader could serve reads before it knew what was committed, returning empty or stale results in a healthy cluster.59 Dgraph shows the other half of the contract: Raft delivers the same log to every replica, and the replicas still diverge if applying it is not deterministic.58

6.4 The join between log and state machine

etcd's own worst recent bug was of this kind. After a restart, a server must know which log entry its database reflects, so etcd stores a "consistent index" in the database. The index and the data change it describes must be written atomically; otherwise a crash leaves an entry either applied twice or skipped. A refactor in v3.5.0 moved the index update into a commit hook that read a shared in-memory value, and another transaction in flight could commit the new index without the corresponding change. Members that crashed at the wrong moment silently diverged from the rest.60 Raft was working as designed throughout; the log was identical on every member.

6.5 Proofs, models and their reach

Raft has an unusually good formal record, and its limits are informative. The dissertation includes a TLA+ specification and a hand proof of safety, about 3,500 words, for the basic algorithm of its Chapter 3; the authors report that model checking at useful sizes was not feasible for them and that a fully mechanical proof was too tedious to complete.3, 61 The Verdi project then produced a machine-checked proof of state machine safety in Coq: 530 lines of implementation, 50,000 lines of proof and 90 invariants. It covers safety only, and the verified implementation does not include reconfiguration or log compaction.62 The single-server membership bug sat in the part no proof covered.

More recent work aims at the implementation. Microsoft's CCF team wrote a TLA+ specification of their Raft-derived protocol, model-checked it, and validated traces from the C++ code against it in CI. They report six bugs caught before production. One was a leader tallying election votes against the union of active configurations instead of each configuration separately, which could elect two leaders in a term. Another was a leader advancing its commit index for entries from earlier terms without a current-term entry, the rule from Section 1.4.63 etcd-io/raft now ships a TLA+ specification that models its own reconfiguration behaviour, and a build tag that emits traces for validation against it.64 etcd's robustness tests have also been run under Antithesis's deterministic hypervisor: 830 wall-clock hours that the team equates to 4.5 years of use, which turned up a watch bug present in every stable release. The post does not attribute any of the findings to the Raft layer.65

Section 7: Trade-offs — Raft and Its Neighbours

7.1 Multi-Paxos: the same machine with a different election

Howard and Mortier rewrote Multi-Paxos in Raft's vocabulary to isolate what actually differs, and found one thing: how a leader is chosen and how it comes to hold the committed entries.66 In Raft only a server with an up-to-date log can win, so nothing needs to be transferred to the new leader. In Paxos any server can win, and the voters send it the entries it is missing as part of the election. Raft pays for its rule with split votes, since candidates in the same term can tie, where in Paxos the higher term simply wins. Paxos pays with a heavier election and with log entries that are re-proposed under new terms.66

Their conclusion is that the two are not significantly different in understandability once presented the same way, and that Raft's election is "surprisingly efficient" for its simplicity.66

7.2 Zab: the same shape, earlier

ZooKeeper's atomic broadcast predates Raft and resembles it closely. Transaction ids are 64-bit numbers with the leadership epoch in the high 32 bits and a counter in the low 32, which play the role of term and index. The elected leader must have seen the highest id among its quorum. Before it serves anything it synchronises followers, sending missing proposals or a full snapshot, and then commits a NEW_LEADER proposal, which does the job of Raft's no-op.67 The influence ran both ways: the dissertation credits ZooKeeper's election as the inspiration for Pre-Vote.3

7.3 KRaft: Raft turned around

Kafka's metadata quorum is the most instructive variant, because it changes the direction of replication and has to rediscover everything in this paper from the other side. In KIP-595 followers pull: voters and observers send Fetch requests to the leader, as Kafka replicas always have. The stated reasons are reuse of Kafka's log layer, cheap observers, and the fact that a leader can simply refuse fetches from a removed member, which handles disruptive servers without extra machinery.68 The costs are up to one fetch interval of added commit latency and limited pipelining.68

The rest maps one to one. With no push heartbeat, a new leader announces itself with BeginQuorumEpoch. A leader that stops receiving fetches from a majority within quorum.fetch.timeout.ms starts a new election, which is the pull-based form of check-quorum. A new leader appends a LeaderChangeMessage control record and does not advance the high watermark until it commits, which is the no-op.68 Pre-Vote arrived later in KIP-996, and dynamic membership in KIP-853, using single-voter changes with the 2015 fix; KIP-595 had rejected joint consensus as hard to reason about.69, 35, 68

RaftMulti-PaxosZabKRaft
Who can leadonly an up-to-date loganyone; catches up during electionhighest zxid in quorumonly an up-to-date log
New leader's first actcommit a no-opre-propose undecided entriessync, then commit NEW_LEADERcommit a LeaderChangeMessage
Replicationleader pushesleader pushesleader pushesfollowers pull
Log orderstrictly sequentialgaps allowedstrictly sequentialstrictly sequential
Membership changejoint consensus or one at a timeleft to the implementernot covered hereone voter at a time

The rows for Raft and Multi-Paxos follow Howard and Mortier and the Chubby paper; Zab and KRaft follow their own documentation.66, 4, 67, 68, 35

7.4 Choosing

For most teams the real choice is between using a Raft-backed service and embedding a Raft library. If the need is configuration, leader election or locks for other services, run etcd or Consul and keep consensus out of your codebase; note Jepsen's warning that a lock from such a service is an optimisation unless the protected resource also checks a fencing token.29 If you are building a replicated service with one consistent state, hashicorp/raft gets you there with the least code. If you are building a sharded database with thousands of groups per node, you need a library shaped like etcd-io/raft, and the engineering described in Section 5.7.

Whichever you pick, keep the voting set small. etcd's FAQ suggests no more than seven members, since every write must be replicated to a majority, and an even-sized cluster adds a member without adding any failure tolerance.17 Scale reads with learners, non-voters or follower reads instead of more voters.

Conclusion: A Checklist More Than an Algorithm

The mental model to keep is that Raft is three guarantees stacked on one assumption. Given durable votes and logs, an election can only be won by a server holding every committed entry, a leader only commits by way of its own term, and logs that match at one position match everywhere before it. Everything else in a production system is there either to keep a stable leader in place (Pre-Vote, check-quorum, leases on voting), to answer the questions the log does not (who may read, who is a member, what to forget), or to protect the assumption (fsync, checksums, identity).

Reading an implementation, or reviewing your own, these are the questions worth asking in order:

  1. Does a new leader commit an entry in its own term before it serves reads, counts old entries as committed, or starts a membership change? Three separate bugs in this paper come from skipping that step.
  2. Are Pre-Vote and check-quorum both on? Either one alone leaves a partial partition that prevents a stable leader.
  3. What does a read cost, and what does it assume? A quorum round trip assumes nothing. A lease assumes bounded clock drift and adds its length to failover time. A local read is stale by design.
  4. Do new members catch up as non-voters first, and is one change committed before the next begins?
  5. Is every acknowledgement preceded by an fsync, and what does a node do when it finds its log corrupt?
  6. Is the applied index stored atomically with the state it describes, and is apply deterministic?
  7. Can a retried client request execute twice?

There are cases where Raft is the wrong tool. It tolerates crashes and message loss, and the paper assumes non-Byzantine servers, so it does not defend against a member that lies.1 It needs a majority, so it cannot make a two-node system survive the loss of either node; the etcd library's own documentation warns against relying on two-node groups.5 All writes pass through one leader and one fsync path, so a single group is a poor fit for high-volume data that does not need a total order. Kafka uses its Raft quorum for cluster metadata.68

The larger lesson of the past decade is about where confidence comes from. The algorithm was proved, and the proof was right, and systems built on it still lost data in the parts the proof did not reach. The implementations that have earned trust did it the slow way: deterministic cores that can be tested without clocks, model checking tied to the real code, fault injection that includes the disk, and public post-mortems when something slipped through. Raft made consensus understandable. Making it dependable is still mostly the implementer's work.

Sources

  1. In Search of an Understandable Consensus Algorithm (Extended Version), D. Ongaro and J. Ousterhout — raft.github.io, accessed 28 November 2026. https://raft.github.io/raft.pdf
  2. The Raft Consensus Algorithm — raft.github.io, accessed 28 November 2026. https://raft.github.io/
  3. Consensus: Bridging Theory and Practice (PhD dissertation), D. Ongaro, Stanford University, 2014 — ongardie/dissertation on GitHub, accessed 28 November 2026. https://github.com/ongardie/dissertation/blob/master/stanford.pdf
  4. Paxos Made Live: An Engineering Perspective, T. Chandra, R. Griesemer and J. Redstone, PODC 2007 — Google Research, accessed 28 November 2026. https://static.googleusercontent.com/media/research.google.com/en//archive/paxos_made_live.pdf
  5. etcd-io/raft README: features, usage and the Ready loop — etcd-io/raft on GitHub, accessed 28 November 2026. https://github.com/etcd-io/raft/blob/main/README.md
  6. hashicorp/raft README — hashicorp/raft on GitHub, accessed 28 November 2026. https://github.com/hashicorp/raft/blob/main/README.md
  7. Students' Guide to Raft, J. Gjengset, 16 March 2016 — thesquareplanet.com, accessed 28 November 2026. https://thesquareplanet.com/blog/students-guide-to-raft/
  8. Jepsen: NATS 2.12.1, K. Kingsbury, 8 December 2025 — jepsen.io, accessed 28 November 2026. https://jepsen.io/analyses/nats-2.12.1
  9. Tuning (content/en/docs/v3.6/tuning.md), etcd v3.6 documentation source — etcd-io/website on GitHub, accessed 28 November 2026. https://github.com/etcd-io/website/blob/main/content/en/docs/v3.6/tuning.md
  10. Configuration options (content/en/docs/v3.6/op-guide/configuration.md), etcd v3.6 documentation source — etcd-io/website on GitHub, accessed 28 November 2026. https://github.com/etcd-io/website/blob/main/content/en/docs/v3.6/op-guide/configuration.md
  11. server/embed/config.go: etcd server flags and validation — etcd-io/etcd on GitHub, accessed 28 November 2026. https://github.com/etcd-io/etcd/blob/main/server/embed/config.go
  12. raft.go: Config, vote handling, check-quorum and read-index code — etcd-io/raft on GitHub, accessed 28 November 2026. https://github.com/etcd-io/raft/blob/main/raft.go
  13. config.go: Config and DefaultConfig — hashicorp/raft on GitHub, accessed 28 November 2026. https://github.com/hashicorp/raft/blob/main/config.go
  14. util.go: randomTimeout — hashicorp/raft on GitHub, accessed 28 November 2026. https://github.com/hashicorp/raft/blob/main/util.go
  15. Consul server architecture reference: Raft multiplier and hardware requirements — HashiCorp Developer, accessed 28 November 2026. https://developer.hashicorp.com/consul/docs/reference/architecture/server
  16. TiKV Configuration File (tikv-configuration-file.md), raftstore section — pingcap/docs on GitHub, accessed 28 November 2026. https://github.com/pingcap/docs/blob/master/tikv-configuration-file.md
  17. Frequently Asked Questions (content/en/docs/v3.6/faq.md), etcd v3.6 documentation source — etcd-io/website on GitHub, accessed 28 November 2026. https://github.com/etcd-io/website/blob/main/content/en/docs/v3.6/faq.md
  18. CHANGELOG.md — hashicorp/raft on GitHub, accessed 28 November 2026. https://github.com/hashicorp/raft/blob/main/CHANGELOG.md
  19. Raft pre-vote extension implementation, pull request #530 — hashicorp/raft on GitHub, accessed 28 November 2026. https://github.com/hashicorp/raft/pull/530
  20. raft.go: follower, candidate and leader loops — hashicorp/raft on GitHub, accessed 28 November 2026. https://github.com/hashicorp/raft/blob/main/raft.go
  21. A Byzantine failure in the real world (post-mortem of the 2 November 2020 incident) — The Cloudflare Blog, accessed 28 November 2026. https://blog.cloudflare.com/a-byzantine-failure-in-the-real-world/
  22. Raft does not Guarantee Liveness in the face of Network Faults, H. Howard and I. Abraham, 12 December 2020 — Decentralized Thoughts, accessed 28 November 2026. https://decentralizedthoughts.github.io/2020-12-12-raft-liveness-full-omission/
  23. server/etcdserver/bootstrap.go: the raft.Config etcd builds — etcd-io/etcd on GitHub, accessed 28 November 2026. https://github.com/etcd-io/etcd/blob/main/server/etcdserver/bootstrap.go
  24. api.go: Apply, Barrier, VerifyLeader, AddVoter, LeadershipTransfer — hashicorp/raft on GitHub, accessed 28 November 2026. https://github.com/hashicorp/raft/blob/main/api.go
  25. Consistent reads are not consistent, issue #741, opened 18 April 2014 — etcd-io/etcd on GitHub, accessed 28 November 2026. https://github.com/etcd-io/etcd/issues/741
  26. Jepsen: etcd and Consul, K. Kingsbury, 9 June 2014 — aphyr.com, accessed 28 November 2026. https://aphyr.com/posts/316-jepsen-etcd-and-consul
  27. read_only.go: ReadState and the read-only request queue — etcd-io/raft on GitHub, accessed 28 November 2026. https://github.com/etcd-io/raft/blob/main/read_only.go
  28. KV API guarantees (content/en/docs/v3.6/learning/api_guarantees.md), etcd v3.6 documentation source — etcd-io/website on GitHub, accessed 28 November 2026. https://github.com/etcd-io/website/blob/main/content/en/docs/v3.6/learning/api_guarantees.md
  29. Jepsen: etcd 3.4.3, K. Kingsbury, 30 January 2020 — jepsen.io, accessed 28 November 2026. https://jepsen.io/analyses/etcd-3.4.3
  30. Consistency modes — HashiCorp Developer, Consul API documentation, accessed 28 November 2026. https://developer.hashicorp.com/consul/api-docs/features/consistency
  31. How TiKV Uses "Lease Read" to Guarantee High Performances, Strong Consistency and Linearizability, S. Tang, 27 February 2020 — TiKV blog, accessed 28 November 2026. https://tikv.org/blog/lease-read/
  32. Replication Layer — CockroachDB documentation (stable), accessed 28 November 2026. https://docs.cockroachlabs.com/docs/stable/architecture/replication-layer
  33. Jepsen: jetcd 0.8.2, K. Kingsbury, 8 August 2024 — jepsen.io, accessed 28 November 2026. https://jepsen.io/analyses/jetcd-0.8.2
  34. bug in single-server membership changes, D. Ongaro, 10 July 2015 — raft-dev Google Group, accessed 28 November 2026. https://groups.google.com/g/raft-dev/c/t4xj6dJTP6E/m/d2D9LrWRza8J
  35. KIP-853: KRaft Controller Membership Changes — Apache Kafka wiki, accessed 28 November 2026. https://cwiki.apache.org/confluence/display/KAFKA/KIP-853%3A+KRaft+Controller+Membership+Changes
  36. etcd Learner design (content/en/docs/v3.6/learning/design-learner.md), G. Lee and J. Betz — etcd-io/website on GitHub, accessed 28 November 2026. https://github.com/etcd-io/website/blob/main/content/en/docs/v3.6/learning/design-learner.md
  37. membership.md: plan for reworking cluster membership changes, D. Ongaro and S. Fell — hashicorp/raft on GitHub, accessed 28 November 2026. https://github.com/hashicorp/raft/blob/main/membership.md
  38. pkg/kv/kvserver/replica_command.go: replication changes, learners and joint configurations — cockroachdb/cockroach on GitHub, accessed 28 November 2026. https://github.com/cockroachdb/cockroach/blob/master/pkg/kv/kvserver/replica_command.go
  39. Availability and Region Failure: Joint Consensus in CockroachDB, T. Grieger, 26 November 2019 — Cockroach Labs blog, accessed 28 November 2026. https://www.cockroachlabs.com/blog/joint-consensus-raft/
  40. raftpb/raft.proto: ConfChangeV2 and ConfChangeTransition — etcd-io/raft on GitHub, accessed 28 November 2026. https://github.com/etcd-io/raft/blob/main/raftpb/raft.proto
  41. quorum/joint.go: JointConfig — etcd-io/raft on GitHub, accessed 28 November 2026. https://github.com/etcd-io/raft/blob/main/quorum/joint.go
  42. confchange/confchange.go: EnterJoint, LeaveJoint and Simple — etcd-io/raft on GitHub, accessed 28 November 2026. https://github.com/etcd-io/raft/blob/main/confchange/confchange.go
  43. Runtime reconfiguration design (content/en/docs/v3.6/op-guide/runtime-reconf-design.md), etcd v3.6 documentation source — etcd-io/website on GitHub, accessed 28 November 2026. https://github.com/etcd-io/website/blob/main/content/en/docs/v3.6/op-guide/runtime-reconf-design.md
  44. Jepsen: RethinkDB 2.2.3 reconfiguration, K. Kingsbury, 22 January 2016 — aphyr.com, accessed 28 November 2026. https://aphyr.com/posts/330-jepsen-rethinkdb-2-2-3-reconfiguration
  45. server/etcdserver/server.go: DefaultSnapshotCount and DefaultSnapshotCatchUpEntries — etcd-io/etcd on GitHub, accessed 28 November 2026. https://github.com/etcd-io/etcd/blob/main/server/etcdserver/server.go
  46. Announcing etcd v3.6.0, B. Wang, 15 May 2025 — etcd blog, accessed 28 November 2026. https://etcd.io/blog/2025/announcing-etcd-3.6/
  47. fsm.go: FSM, BatchingFSM and FSMSnapshot — hashicorp/raft on GitHub, accessed 28 November 2026. https://github.com/hashicorp/raft/blob/main/fsm.go
  48. Consensus — HashiCorp Developer, Consul architecture documentation, accessed 28 November 2026. https://developer.hashicorp.com/consul/docs/architecture/consensus
  49. tracker/state.go: StateProbe, StateReplicate, StateSnapshot — etcd-io/raft on GitHub, accessed 28 November 2026. https://github.com/etcd-io/raft/blob/main/tracker/state.go
  50. tracker/progress.go: Progress — etcd-io/raft on GitHub, accessed 28 November 2026. https://github.com/etcd-io/raft/blob/main/tracker/progress.go
  51. doc.go: package documentation and message types — etcd-io/raft on GitHub, accessed 28 November 2026. https://github.com/etcd-io/raft/blob/main/doc.go
  52. tracker/inflights.go: Inflights — etcd-io/raft on GitHub, accessed 28 November 2026. https://github.com/etcd-io/raft/blob/main/tracker/inflights.go
  53. server/etcdserver/raft.go: maxSizePerMsg and maxInflightMsgs — etcd-io/etcd on GitHub, accessed 28 November 2026. https://github.com/etcd-io/etcd/blob/main/server/etcdserver/raft.go
  54. replication.go: per-follower replication, pipelining and snapshot shipping — hashicorp/raft on GitHub, accessed 28 November 2026. https://github.com/hashicorp/raft/blob/main/replication.go
  55. hashicorp/raft-wal README — hashicorp/raft-wal on GitHub, accessed 28 November 2026. https://github.com/hashicorp/raft-wal/blob/main/README.md
  56. Protocol-Aware Recovery for Consensus-Based Storage, R. Alagappan et al., FAST 2018 — USENIX, accessed 28 November 2026. https://www.usenix.org/system/files/conference/fast18/fast18-alagappan.pdf
  57. Scaling Raft, B. Darnell, 12 June 2015 — Cockroach Labs blog, accessed 28 November 2026. https://www.cockroachlabs.com/blog/scaling-raft/
  58. Jepsen: Dgraph 1.0.2, K. Kingsbury, 23 August 2018 — jepsen.io, accessed 28 November 2026. https://jepsen.io/analyses/dgraph-1-0-2
  59. Jepsen: Redis-Raft 1b3fbf6, K. Kingsbury, 23 June 2020 — jepsen.io, accessed 28 November 2026. https://jepsen.io/analyses/redis-raft-1b3fbf6
  60. v3.5 data inconsistency postmortem, M. Siarkowicz, 20 April 2022 — etcd-io/etcd on GitHub, accessed 28 November 2026. https://github.com/etcd-io/etcd/blob/main/Documentation/postmortems/v3.5-data-inconsistency.md
  61. raft.tla README: formal TLA+ specification for the Raft consensus algorithm — ongardie/raft.tla on GitHub, accessed 28 November 2026. https://github.com/ongardie/raft.tla/blob/master/README.md
  62. Planning for Change in a Formal Verification of the Raft Consensus Protocol, D. Woos et al., CPP 2016 — University of Washington, accessed 28 November 2026. https://homes.cs.washington.edu/~mernst/pubs/raft-proof-cpp2016.pdf
  63. Smart Casual Verification of the Confidential Consortium Framework, H. Howard et al., arXiv:2406.17455v2, 16 October 2024 — arXiv, accessed 28 November 2026. https://arxiv.org/pdf/2406.17455
  64. tla/README.md: TLA+ Specification and Trace Validation for Raft Library — etcd-io/raft on GitHub, accessed 28 November 2026. https://github.com/etcd-io/raft/blob/main/tla/README.md
  65. Autonomous Testing of etcd's Robustness, M. Siarkowicz, 3 October 2025 — etcd blog, accessed 28 November 2026. https://etcd.io/blog/2025/autonomus_testing_with_antithesis/
  66. Paxos vs Raft: Have we reached consensus on distributed consensus?, H. Howard and R. Mortier, arXiv:2004.05074v2, 27 April 2020 — arXiv, accessed 28 November 2026. https://arxiv.org/pdf/2004.05074
  67. ZooKeeper Internals (release 3.9.3): atomic broadcast — Apache ZooKeeper documentation, accessed 28 November 2026. https://zookeeper.apache.org/doc/r3.9.3/zookeeperInternals.html
  68. KIP-595: A Raft Protocol for the Metadata Quorum — Apache Kafka wiki, accessed 28 November 2026. https://cwiki.apache.org/confluence/display/KAFKA/KIP-595%3A+A+Raft+Protocol+for+the+Metadata+Quorum
  69. KIP-996: Pre-Vote — Apache Kafka wiki, accessed 28 November 2026. https://cwiki.apache.org/confluence/display/KAFKA/KIP-996%3A+Pre-Vote