{
  "slug": "raft",
  "term": "Raft",
  "aliases": [
    "Raft consensus"
  ],
  "definition": "Raft is a leader-based consensus algorithm that manages an ordered replicated log for a deterministic state machine.",
  "note": "For the paper's log-free read protocol, a leader first commits an entry from its own term, typically a no-op, to establish the committed prefix. This is a per-term prerequisite, not an entry per read. Quorum-confirmed reads need leadership evidence after the read begins; lease reads assume bounded clock skew. [raft-paper]\n\netcd v3.6.0 swaps read notifiers before requesting the next confirmed index. Readers holding the old notifier share one confirmation; readers capturing the new notifier after the swap wait for a subsequent round. [etcd-read]\n\nCommitment and application are separate. The linearizable-read path waits when the applied index is lower than the index confirmed for the matching request. Equality suffices for this application-progress check. [etcd-read]\n\nThe KV linearizability guarantee does not cover optional serializable reads or watches. Check each operation's API contract. [etcd-guarantees]\n\nA leader can commit then crash before replying; a retry can execute again. Section 8 tracks each client's latest command serial number and result so a recognized retry returns the previous response. Log agreement alone does not deduplicate client requests. [raft-paper]\n\nRIFL separately requires completion records and mutation effects to become durable atomically; this is not implied for every Raft service. [rifl]\n\nA latest-result slot is not a general concurrent-request design. For a live client, RIFL uses an acknowledged sequence prefix for reclamation; an earlier outstanding RPC can retain later results. [rifl]\n\nPersist currentTerm and votedFor before RPC replies. Losing a vote on restart can defeat the one-vote-per-term rule despite majority intersection. [raft-paper]",
  "status": "shipping",
  "advantages": [],
  "limitations": [
    {
      "text": "The paper assumes non-Byzantine behavior; arbitrary malicious participants are outside that model.",
      "citationIds": [
        "raft-paper"
      ]
    },
    {
      "text": "The etcd read check compares Raft log indices, not the API's KV revision. One modifying transaction advances the KV revision once across its changed keys; a transaction with no MVCC changes does not advance it. These counters are not interchangeable.",
      "citationIds": [
        "etcd-read",
        "etcd-mvcc"
      ]
    },
    {
      "text": "In a constructed three-voter trace, A and B elect A; B replies, restarts and forgets its vote, then B and C elect C in the same term. Persisting B's term and vote before replying blocks this trace. Writing after the reply leaves a crash window. This isolates vote memory with equal empty logs, not log commitment or complete Raft.",
      "citationIds": [
        "restart-vote-memory"
      ]
    },
    {
      "text": "The author's errata qualify lastApplied: its lifetime must match the state machine's. A durable state machine needs durable applied progress; treating the index as always volatile is unsafe.",
      "citationIds": [
        "raft-errata"
      ]
    }
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-20",
  "related": [
    "raft-joint-consensus",
    "linearizability",
    "quorum-intersection",
    "write-ahead-log",
    "retry-deduplication",
    "flp-impossibility",
    "partial-synchrony",
    "delos",
    "erpc",
    "consensus",
    "state-machine-replication",
    "crash-recovery"
  ],
  "citations": [
    {
      "id": "raft-paper",
      "title": "Ongaro and Ousterhout: In Search of an Understandable Consensus Algorithm, extended version (20 May 2014), Figure 2 and sections 5.2, 5.4, 6 and 8.",
      "url": "https://raft.github.io/raft.pdf",
      "accessed": "2026-11-04"
    },
    {
      "id": "etcd-read",
      "title": "etcd v3.6.0: Range, linearizableReadLoop and requestCurrentIndex",
      "url": "https://raw.githubusercontent.com/etcd-io/etcd/v3.6.0/server/etcdserver/v3_server.go",
      "accessed": "2026-11-04"
    },
    {
      "id": "etcd-guarantees",
      "title": "etcd v3.6: KV, watch and completion guarantees",
      "url": "https://etcd.io/docs/v3.6/learning/api_guarantees/",
      "accessed": "2026-11-04"
    },
    {
      "id": "hesela-consistency",
      "title": "Hesela: storage consistency, Raft commitment and read safety",
      "url": "https://hesela.com/analyses/storage-consistency-ordering/#raft-reads",
      "accessed": "2026-11-04"
    },
    {
      "id": "rifl",
      "title": "Lee et al.: Implementing Linearizability at Large Scale and Low Latency. SOSP 2015, Figure 2, sections 3-4.3; DOI 10.1145/2815400.2815416.",
      "url": "https://web.stanford.edu/~ouster/cgi-bin/papers/rifl.pdf",
      "accessed": "2026-11-04"
    },
    {
      "id": "etcd-mvcc",
      "title": "etcd v3.6.0: MVCC storeTxnWrite.End and put, revision advancement and per-key subrevisions",
      "url": "https://raw.githubusercontent.com/etcd-io/etcd/v3.6.0/server/storage/mvcc/kvstore_txn.go",
      "accessed": "2026-11-04"
    },
    {
      "id": "restart-vote-memory",
      "title": "Hesela. Restarted voters: an executable vote-memory counterexample, six crash schedules and tests.",
      "url": "https://hesela.dev/research/restart-vote-memory/README.md",
      "accessed": "2026-11-20"
    },
    {
      "id": "raft-errata",
      "title": "Diego Ongaro. Consensus: Bridging Theory and Practice, author errata for Figure 3.1 (Chapter 3), repository revision 0c10ea1b53d73bf6d163bdde8e4141a1cbd8f36a.",
      "url": "https://github.com/ongardie/dissertation/blob/0c10ea1b53d73bf6d163bdde8e4141a1cbd8f36a/README.md#chapter-3-basic-raft-algorithm",
      "accessed": "2026-11-20"
    }
  ],
  "provenance": [
    "The algorithm definition follows the original extended paper; implementation details are scoped to etcd v3.6.0 source inspection. No cluster experiment or performance measurement was performed. [raft-paper] [etcd-read]"
  ]
}
