Time, Identity, Membership and Failure
A timeout is evidence, not proof of death. Logical order, process incarnation and fencing let the system act safely even when clocks, networks and failure detectors disagree.
Section 2 of 9 · 12 units · about 50 hours
By the end you can Given a fault history, classify known, concurrent and unknowable order, demonstrate membership convergence with measured false-suspicion trade-offs, and prove that a stale actor cannot commit after authority moves.
Units
- Wall and monotonic clocks, drift, skew, backward jumps and synchronization uncertainty4h
- Happens-before, Lamport clocks and total-order tie breaking4h
- Vector clock comparison, concurrency and dotted version vectors4h
- Hybrid logical clock state, persistence and implementation4h
- Unique identifiers, incarnation numbers and restart-safe identity4h
- Heartbeats, observation windows, detector completeness and accuracy, and suspicion thresholds4h
- False suspicion, a \(\phi\) accrual detector and detection-delay measurement4h
- Gossip dissemination, a gossip membership implementation and convergence measurement5h
- Membership join, leave and replacement, versioned views and stale-view handling4h
- Partitions, asymmetric reachability, split-brain boundaries and correlated failure domains4h
- Leases, process pauses, fencing tokens and a lease implementation5h
- Deterministic membership and network simulation4h
Build it
Mini project · about 14 to 20 hours
Restart-safe clocks, membership and fenced authority
Extend loglab with clocks, durable actor identities, heartbeat detectors, gossip membership and a fenced lease service. Replay deterministic schedules on your machine before any timing run, keeping membership convergence separate from exclusive authority and naming the assumptions needed for progress.
- 1Add injectable wall and monotonic clocks in
clock/, with skew, drift, jumps and uncertainty intervals. Check Lamport stamps, vector comparisons and per-key dotted versions against an independently constructed happens-before graph and causal event sets; retain concurrency, context-subsumption and member-replacement fixtures. - 2Implement HLC updates and restart-safe IDs with durable clock pairs and identity epochs. Check HLC transitions against the paper's Figure 5 and IDs against a set oracle across restart and dual-incarnation schedules; retain bound-violation alerts and separate Gossip Glomers Unique ID Generation results.
- 3Build configurable fixed-threshold and accrual detectors in
member/. Replay recorded arrivals under delay, observer and peer pauses, overload, burst loss and partitions; compare suspicion decisions with independent distribution calculations, defining startup and deviation floors, and retain seeds and ground-truth liveness labels. - 4Implement bounded gossip dissemination using
net/. Check fixed schedules against a set-union convergence oracle, then pass Gossip Glomers Broadcast through its partition challenge under Maelstrom; retain run directories and explain duplicate contacts relative to the no-repeat rumor-growth model without claiming ordering or durability. - 5Add versioned membership views with join, leave and fresh-identity replacement. Compare reordered Suspect, Alive and Confirm transitions with an independent original-SWIM transition table; retain stale-view and incarnation tests, terminal-report handling and seeds, explicitly separating gossip views from authority configurations.
- 6Implement lease acquire, renew and release with owner-token checks and durable resource-side fencing. Against a sequential grant model, test expiry, pauses, delayed renewal, partitions and restart; retain stale writes before and after token installation, the activation boundary and a fixed-configuration majority-authority fixture.
- 7Extend campaigns with asymmetric reachability, correlated failures, clock jumps, split-brain attempts and healing; assert fencing after every transition and retain identical replays plus a minimized failure. After correctness gates, compare detector delay against false suspicion across thresholds and windows; report repeated gossip-convergence and traffic measurements.
What you hand in
- The
clock/andmember/components, deterministic timer integration, restart-safe identity contract and resource-side fencing boundary. - Causal and transition oracles, replayable fault histories, public-suite results and a minimized regression with seeds and explicit schedules.
- Detector trade-off curves and gossip cost report from retained traces, separating simulated progress from process timings and authority guarantees.
How to check it
- Self-grade with the rubric below
- Gossip Glomers 2: Unique ID Generation
Keep Maelstrom results separately; your restart and dual-incarnation tests establish guarantees this network-only challenge does not check.
- Gossip Glomers 3a to 3c: Broadcast
Run the single-node, multi-node and partition challenges; retain raw histories without treating their convergence checks as ordering or membership-authority tests.
How it's graded
Causality and identity
Pass: Own graph and event-set oracles validate clocks, concurrency and dotted-context replacement. Figure 5 checks validate HLC cases; restart and dual-incarnation tests catch reused identities independently of Maelstrom.
Great: Planted clock-state loss and dot-subsumption defects fail before repair; out-of-envelope resets explicitly delimit the normal causality guarantee.
Detector evidence
Pass: Own fixed-trace decisions match independent distribution calculations. Curves count live-peer false-suspicion episodes and crash-to-suspicion delay separately, with consistent warmup and retained seeds, versions and arrival traces.
Great: Repeated matched comparisons retain a model-mismatch regime; observer-pause guards are tested without claiming they detect remote pauses or prove death.
Membership and authority
Pass: Own transition-table tests cover stale reports and replacement; set-union checks establish convergence under stated delivery assumptions. Sequential grant checks and durable resource fences reject backward tokens after activation despite incorrect suspicion.
Great: A planted stale-view or fence-persistence defect yields a minimized regression; traces explain why a pre-installation stale write is not retroactively fenced.
Determinism and scope
Pass: Own replay diffs are empty for retained schedules; per-transition safety checks precede repeated timing runs with versions and workloads. Reports separate simulated ticks, process measurements, bounded non-progress and conditional convergence.
Great: The minimized counterexample preserves the violated predicate and environmental assumptions; correlated and asymmetric faults expose a gap missed by independent-node campaigns.
Resources
- DDIA 2e - Chapter 9 The Trouble with Distributed SystemsMartin Kleppmann and Chris Riccomini
Read clocks, pauses, unreliable networks, partial failures and knowledge limits. For each failure, record what a node observes, what is true globally and what action is safe under that uncertainty.
- Time, Clocks, and the Ordering of Events in a Distributed System (Lamport, 1978)Leslie Lamport
Read the partial ordering and logical clocks sections: happens-before, the Clock Condition, rules IR1 and IR2, and the total order. Its ties are broken arbitrarily, so the total order is not causality.
- How to Do Distributed Locking (Kleppmann, 2016)Martin Kleppmann
Read the process-pause, network-delay and fencing-token sections with DDIA 2e Chapter 9 "Distributed Locks and Leases". Treat the Redlock critique as dated to 2016; the lasting lesson is that the storage service must reject a write that carries an older token.
- HLD Handbook - Clocks, Failure Detection and Consistent HashingHLD Handbook
Read Part 3 clocks and ordering, failure detection and consistent hashing. Use its exercises to compare assumptions, then verify claims against your own histories.
- Gossip Glomers - Unique IDs and BroadcastFly.io and Jepsen
Each challenge runs locally under Maelstrom (v0.2.4; the pages were tested on 0.2.3) with its checker and, where the page says so, the partition nemesis; keep the run directory as the history. Do challenge 2 (unique IDs under partition with total availability) and 3a to 3c (broadcast, then with partitions). A pass shows uniqueness or convergence in that run, not ordering or recency.
- Logical Physical Clocks and Consistent Snapshots (Kulkarni et al., 2014)University at Buffalo
Read the hybrid logical clock algorithm and its bounds; the paper reports the logical counter staying well below its proved bound in practice, so measure your own.
- SWIM: Scalable Weakly-consistent Infection-style Process Group Membership (Das et al., 2002)Cornell University
Read the direct and indirect probing detector, infection-style dissemination, the suspicion mechanism and incarnation numbers. Suspicion timeouts depend on the workload.
- The phi Accrual Failure Detector (Hayashibara et al., 2004)JAIST
Read how phi is computed from the heartbeat inter-arrival history and how a threshold trades detection time for false suspicion. Its normal approximation misleads under bursty delay, so test with pause traces too.
- Cambridge Concurrent and Distributed Systems Notes (Kleppmann) - Time, Clocks and OrderingUniversity of Cambridge (Martin Kleppmann)
Use Chapter 3 (physical clocks, NTP and monotonic clocks, happens-before) and Section 4.1 (Lamport and vector clocks with worked examples) as the derivation workbook: work Exercises 7 to 13. Each section marks where its public lecture video starts.
- MIT 6.5840 - Failure and Paper Discussion LensMIT PDOS
Use the RPC, GFS, Raft and consistency lectures to identify which timing assumptions affect progress and which invariants must not depend on time. Do not start the Raft lab yet.
- Replicated Log and Stream Processor - Time and Membership SliceRoadmap-Final
Add incarnation IDs, logical timestamps, gossip membership, suspicion metrics and fenced ownership. Retain seeds and minimized traces for every false-failure or stale-actor case.
- AlgoMaster System Design practice - clock, gossip and lease drillsAlgoMaster
Use only the named problems: Advance a Lamport Logical Clock, Compare Two Vector Clocks, Update a Vector Clock on Receive, Advance a Hybrid Logical Clock, Simulate Gossip Rumor Spread and Implement a Lease Lock with Fencing Tokens. Each states its function signature and checks small deterministic cases.
- Building Distributed Systems - The TimekeeperBuild Distributed Systems
Only the first three tasks are free (clock reads and backward jumps, a monotonic wrapper, a split-brain lease). Tasks are graded in the browser after login, so treat a pass as a drill and keep your local harness as the evidence.
- Building Distributed Systems - The GossiperBuild Distributed Systems
Only the first three tasks are free (basic broadcast, tree topology, random gossip). Tasks are graded in the browser after login, so treat a pass as a drill and keep your local harness as the evidence.