liveBook · Manning

State machine safety

As explained in Think Distributed Systems

State machine safety is the property that no two processes apply different log entries at the same index to their state machines.

State machine safety guarantees that no two processes apply different log entries at the same index to their application state machines. Once an entry is committed, it is never lost or overwritten. section 10.6.5

Raft protects this property through leader election: only a candidate with the most up-to-date log may lead. A log is newer when its final term is later, or when terms match and it is longer. Therefore, an entry replicated to a quorum must appear in every future leader’s log. section 10.6.1 section 10.6.5

Committed versus uncommitted requests

A leader may accept request 9 without replicating it; if the leader fails, request 9 can disappear without violating state machine safety because it was not committed. If another node has acknowledged the request, however, a future leader must preserve it because the acknowledgment cannot reveal whether commitment occurred before the failure. section 10.7.2 section 10.7.3

Figure 10.3 Raft’s log abstraction
A diagram of a number of indexes

AI-generated content may be incorrect.

Visualizes Raft’s log abstraction and the handoff from committed platform-level log entries to application-level state machines. section 10.6.1

How Think Distributed Systems covers it

How deep it goes
Explains the guarantee, quorum relationship, log-recency rules, and failure scenarios without detailing protocol implementation.
Examples
Uses uncommitted and acknowledged client request 9 to contrast loss after failure with mandatory preservation.
What it assumes
Assumes familiarity with replicated logs, terms, quorum, commitment, and leader election.
What you can do after
Evaluate whether leader failure can violate state machine safety by checking commitment and log freshness.
How it connects
Connects log consistency, committed entries, quorum, leader election, log replication, and application state machines.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Think Distributed Systems. The section links point to the parts of the book it draws on.