Unit 7 of 12 · about 4 hours · implement, measure
False suspicion, a \(\phi\) accrual detector and detection-delay measurement
One fixed timeout forces one tradeoff on every consumer. The value separates the suspicion signal from the decision, so each consumer picks its own point on the curve.
You'll be able to
- Name the non-death causes of silence, pause, overload and loss bursts, and show one on a heartbeat trace.
- Implement the computation over a sliding window and trigger suspicion at a chosen threshold.
- Measure detection delay against false-suspicion rate across thresholds and window sizes on one trace.
Covers
Read
In this order, only the parts listed
0 of 3 done
- The accrual detectorThe phi Accrual Failure Detector (Hayashibara et al., 2004)
Report IS-RR-2004-010: Section III-A (monitoring, interpretation and action), Section IV-A Equation 2, Section IV-B Equations 3 and 4 with Figure 4, Section V-A (Switzerland-to-Japan UDP trace and replay), and Sections V-B to V-D, Figures 8 to 10 and Equation 5
Stop after Experiment 3. Treat Equation 5 as the paper's estimate for a crash immediately after sending a heartbeat, not a universal detection-delay bound.
- The detector in productionHLD Handbook - Clocks, Failure Detection and Consistent Hashing
Theory, accrual detectors: the mean-based calculation and The GC-pause guard
Read only this subsection. Its mean-only calculation corresponds to an exponential tail, not the paper's normal fit. Ignore its claim that jitter alone changes this calculation: equal means give equal values regardless of variance. The guard detects pauses of the observer, not arbitrary remote silence.
- Suspicion before convictionSWIM: Scalable Weakly-consistent Infection-style Process Group Membership (Das et al., 2002)
Section 4.2: the suspicion timeout trades longer detection time for fewer false detections
Read for the tradeoff sentence only; the full mechanism returns in the gossip and membership units.
Focus on
- Let be elapsed time since the last received heartbeat. The paper computes from a normal fit to recent inter-arrival intervals. Each extra unit divides the modeled tail probability by ten; it is not the probability that the peer is dead.
- Keep a sliding window of intervals and their sum and sum of squares to estimate and . Define startup behavior and a positive minimum deviation for identical samples. Use a survival function such as
math.erfcrather than subtracting a rounded CDF from one. - Replay the same arrivals for every threshold and window size. Count false-suspicion episodes per unit of live-peer observation time; measure crash-to-suspicion delay on separate injected-crash continuations. Exclude or report warmup consistently, as Section V-A does.
- Remote pause, overload and packet loss can all raise suspicion without a crash. A local-pause guard limits accusations after the observer itself stalls; it cannot guarantee protection from a remote loss burst. Safety still needs an authority protocol and storage-side fencing.
Common mistakes · 3
- Reading a tail probability as a measured false-suspicion rate. Model mismatch and correlated loss can make observed mistakes much more frequent; even quorum agreement cannot prove physical death.
- Moving a threshold across networks. Threshold 8 means different silence seconds under 100 ms and 1 s heartbeats, so recalibrate the curve per deployment.
- Updating the window during silence. No new interval exists until another heartbeat arrives; a long loss burst contributes one long interval on recovery, not one sample per missed beat.
Try it yourself
Closed-book, before checking anything
tail = math.erfc(4 / math.sqrt(2)) / 2 and phi = -math.log10(tail) after import math. This is 20 ms beyond the mean, not 120 ms beyond it.Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.Two applications use thresholds 2 and 8. The signal reaches 5 before a heartbeat arrives. Who suspects, and who may act?Answer
Only the threshold-2 application suspects. The threshold-8 application has not crossed its threshold. Neither gains exclusive authority merely from suspicion; actions must obey the application's coordination and fencing rules.
2.Why does the paper replay recorded traces instead of testing detectors live side by side?Answer
Replay feeds every detector the identical arrival sequence, so threshold and window differences, not network luck, explain the mistake and delay curves.
3.A two-minute loss burst arrives during calm operation. What does report, and what should the deployment do?Answer
With a calm fitted window, suspicion rises and can cross the threshold even though the peer is alive. A local-pause guard does not mask network loss, and a deviation floor gives no such guarantee. Failover must remain safe even when this suspicion is wrong.
4.For one fixed fitted distribution, what changes when the threshold rises from 2 to 12? Does Equation 5 impose a round-trip lower bound?Answer
The equivalent timeout grows. Equation 5 adds estimated one-way propagation to that timeout for a crash immediately after a send. It is not a round-trip lower bound or a formula for every crash phase.
You're done when
You compute the reproduce from memory with its assumption stated, and can place any threshold choice on the delay-versus-mistakes curve for your own trace.
Only when you can do this without notes.
Leads to
Notes
Resources · 3 for this unit, 11 more in the section
- SWIM: Scalable Weakly-consistent Infection-style Process Group Membership (Das et al., 2002)Cornell University · support
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 · support
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.
- HLD Handbook - Clocks, Failure Detection and Consistent HashingHLD Handbook · required
Read Part 3 clocks and ordering, failure detection and consistent hashing. Use its exercises to compare assumptions, then verify claims against your own histories.
Also in this section
- DDIA 2e - Chapter 9 The Trouble with Distributed SystemsMartin Kleppmann and Chris Riccomini · primary
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 · required
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.
- Logical Physical Clocks and Consistent Snapshots (Kulkarni et al., 2014)University at Buffalo · support
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.
- How to Do Distributed Locking (Kleppmann, 2016)Martin Kleppmann · required
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.
- Cambridge Concurrent and Distributed Systems Notes (Kleppmann) - Time, Clocks and OrderingUniversity of Cambridge (Martin Kleppmann) · support
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.
- Building Distributed Systems - The TimekeeperBuild Distributed Systems · optional
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 · optional
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.
- Gossip Glomers - Unique IDs and BroadcastFly.io and Jepsen · required
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.
- MIT 6.5840 - Failure and Paper Discussion LensMIT PDOS · support
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 · support
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 · support
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.