Explain how a heartbeat with a fixed timeout detects failures, and what the timeout trades off.
Sketch your own answer first, then compare it with the one below.
A strong answer
The monitored node sends a small message at a fixed interval. The monitor records when the last one arrived. If the silence since then exceeds the timeout, the monitor marks the node as suspected. A later heartbeat clears the suspicion.
The timeout sets two numbers at once. Detection time for a real crash is a little under the timeout, because part of it had already run down between the last heartbeat and the crash. The false alarm rate is how often a live node goes quiet for longer than the timeout, because of network delay or a pause.
Lengthening the timeout lowers false alarms and raises detection time. Shortening it does the reverse. There is no setting that improves both, so the right value depends on what a false alarm costs compared with a slow detection.
Sources
- Tushar Deepak Chandra, Sam Toueg (1996). Unreliable failure detectors for reliable distributed systems.