Failure Detection: Heartbeats & Phi Accrual
Detect crashed nodes accurately: Fixed timeout pitfalls, heartbeat intervals, and Hayashibara's probabilistic Phi Accrual failure detector.
01.1. The Fundamental Challenge of Distributed Failure Detection
In distributed systems, detecting when a node has failed is a delicate balancing act between two competing metrics:
- Completeness: Every truly crashed node must eventually be identified by the cluster so that standby nodes can be promoted and data rebalanced.
- Accuracy (Speed vs False Positives): The system must avoid falsely declaring a healthy node "dead" due to a transient network blip, router queue spike, or JVM Stop-the-World garbage collection pause.
The Pitfall of Fixed Heartbeat Timeouts:
Traditional systems use a fixed binary timeout: "If no heartbeat arrives within 5 seconds, declare the node dead."
- If the threshold is too aggressive (e.g.,
1s), a brief1.1sGC pause causes false-positive failovers, triggering massive, expensive data resharding storms across the cluster. - If the threshold is too conservative (e.g.,
30s), the cluster wastes half a minute routing traffic to a black-holed server before failing over.
Fixed Timeout vs Phi Accrual Probabilistic Detection π
Fixed Timeout vs Phi Accrual Probabilistic Detection π
Fixed timeouts cause false positives during GC pauses; Phi Accrual adapts dynamically.
Unlock Topic #95: Failure Detection: Heartbeats & Phi Accrual
You are viewing a preview. The full in-depth engineering deep dive, interactive simulators, architecture flowcharts, and self-assessment quizzes for this topic are available with Pro or Lifetime Access.
Failure modes, high-throughput bottlenecks, and real FAANG implementation decisions.
Interactive system topology diagrams, live parameter simulators, and downloadable SVG charts.
Staff-level multiple-choice quiz questions with instant feedback and answer explanations.
Firebase Google authentication automatically syncs your completed topics and quiz scores.
How clear and staff-actionable was this system breakdown?