ZAB (ZooKeeper Atomic Broadcast) — concept page covering leader election → discovery → synchronization → broadcast phases. Shows ZooKeeper ensemble with 5 nodes (1 leader + 4 followers), client. zxid (epoch, counter) transaction IDs, quorum writes, primary-order semantics. Multi-scenario: normal broadcast (PROPOSAL/ACK/COMMIT), leader crash + recovery, follower SNAP/DIFF catch-up.
Zab is a crash-recovery atomic-broadcast protocol tailored to ZooKeeper primary-backup replication. A primary assigns monotonically ordered zxids, pipelines proposals, and commits after quorum acknowledgement. Transactions are prefix-dependent: a delivered transaction cannot skip earlier dependencies.
A new primary first discovers and synchronizes a quorum to a safe prefix before broadcasting new updates. With 2f+1 servers, majority progress tolerates f crashes. Writes stop when no quorum can support a primary. ZooKeeper writes are linearizable, but ordinary reads are served locally and may be stale; sync() is an explicit barrier before a subsequent read.
sync() before a subsequent read provides the documented freshness barrier.leader-broadcast-zxid): The primary assigns an epoch/order zxid and preserves proposal prefix.quorum-ack-commit): A majority durably acknowledges before commit is broadcast and applied.leader-crash-recovery-sync): A new epoch recovers a quorum prefix before any new transaction.stale-read-sync): A follower read may lag; sync before a later read establishes the documented barrier.watch-one-shot-gap): A watch fires once; client rereads and re-registers instead of assuming every intermediate value.minority-partition): A server subset without majority cannot establish a primary or commit updates.Raft consensus is an explore diagram and is linked as Markdown.
Введите числа или выберите пресет