etcd quorum and revisions
What etcd stores
etcd is a distributed key-value database used by the Kubernetes API server to persist cluster objects. For example, when you request three replicas of a Deployment, the API server records desired state; controllers observe that state and act on it. etcd does not schedule Pods or store the contents of application disks. Keep direct etcd access limited to authorized control-plane and backup components. A direct database write would bypass normal Kubernetes API checks.
Client → API server → etcdControllers observe the API → reconcile workloadsRaft and voting majorities
Raft is a consensus algorithm: a leader coordinates an ordered log of proposed changes, and a majority of voting members must participate for normal progress. A majority is more than half of the configured voters, not half of the currently reachable machines. Learners are non-voting members. A stable leader, connectivity and functioning storage are also necessary; the arithmetic is only a capacity check.
voters majority failures tolerated 3 2 1 4 3 1 5 3 2Reason about a network partition
In a five-voter cluster split into groups of three and two, the group of three may elect or retain a leader and commit changes if otherwise healthy. The two-member group cannot independently commit changes. A temporary partition can heal; do not jump to disaster restoration before determining whether the original majority can safely recover. Membership changes require a functioning quorum under ordinary operation.
5 configured voters[A B C] | [D E]3/5: majority possible2/5: no majorityConsistency and revisions
A linearizable read must reflect a state consistent with completed operations; an explicitly serializable etcd read may be served locally and be stale. A revision identifies a change to the keyspace: multiple keys updated in a single transaction share a revision. It is not a wall-clock timestamp or a count of individual keys. Watches deliver changes in revision order within their guarantees; a watch is not a linearizable read and can lag.
Illustrative keyspace historyrevision 20: catalog=Arevision 21: catalog=B, inventory=10 (one transaction)revision 22: inventory=9Keep Kubernetes resourceVersion separate
The Kubernetes API exposes resourceVersion for change tracking, watch resumption and concurrency. Treat it as an API token; pass the returned value back according to the documented API contract. Do not equate it with a direct etcd revision, use arithmetic to find the next value, or rely on a numeric relationship across unrelated resource types. For a watch that returns 410 Gone because its history is unavailable, obtain a fresh list and resume from its returned collection version.
Synthetic API traceLIST → collection resourceVersion="opaque-token-a"WATCH from that token → 410 GoneLIST again → replace cache and resumeDiagnose control-plane pressure
Slow disks or congested peer links can lengthen replication and elections. Observe API latency, leader changes, disk latency, quota alarms and member health together using sanitized, authorized monitoring. API timeouts alone do not prove quorum loss. Already-running workloads may continue during control-plane failures, but scheduling, updates and reconciliation can be impaired. Preserve evidence and escalate before changing membership.
Evidence A: five voters, only two mutually reachable → majority unavailableEvidence B: three reachable, slow disk writes → investigate latency; not proof of quorum lossPractice and next step
Use quorum-cases.json and history-cases.json in the offline fixture directory. Calculate the majority for each configured membership and identify when a watch cache must be refreshed. Explain why adding a voter to a four-member cluster changes tolerance, and why deleting a failed member is not a generic recovery procedure. Next: snapshots, compaction and recovery.
Further reading
Primary documentation (etcd v3.6 where versioned; checked 2026-11-28):
- https://etcd.io/docs/v3.6/faq/
- https://etcd.io/docs/v3.6/learning/api_guarantees/
- https://etcd.io/docs/v3.6/dev-guide/interacting_v3/
- https://etcd.io/docs/v3.6/op-guide/maintenance/
- https://kubernetes.io/docs/tasks/administer-cluster/configure-upgrade-etcd/
- https://kubernetes.io/docs/reference/using-api/api-concepts/
- https://kubernetes.io/docs/reference/kubernetes-api/definitions/object-meta-v1-meta/
- https://kubernetes.io/docs/concepts/security/api-server-bypass-risks/
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
etcd quorum and revisions — knowledge check
Understand how etcd persists Kubernetes state, calculate voting quorum, and distinguish keyspace revisions from API watch tokens.
Five configured voting members split into groups of three and two. Which can potentially commit changes?
How many failures can four voting members tolerate under the majority model?
What revision does a transaction modifying two keys use?
A Kubernetes watch returns 410 Gone because history expired. What should the client do?
What does a control-plane API timeout establish by itself?