Q&A-14Explain why a distributed system cannot distinguish a slow node from a failed one.
Answer
The 90-second answer
A node that has failed and a node that is merely slow produce the same thing at the observer: no reply. The observer has no channel to the node other than messages, so "no message arrived by time t" is one observation with at least five causes: crashed, alive but stalled, request lost, reply lost, or processed-and-ack-lost. Nothing in the observation separates them.
No amount of waiting fixes this, because in an asynchronous network there is no bound on message delay you can rely on. If you knew every message arrived within 500 ms, a 1 s silence would mean failure. You don't know that, and a node in a 3 s GC pause is indistinguishable from a node that is gone. This is the FLP result: in a fully asynchronous system with one crash-faulty process, no deterministic protocol solves consensus. Dwork, Lynch and Novák showed the escape hatch, assume bounds exist but are unknown (partial synchrony), which is why every real system has a timeout somewhere.
The same observation, different worlds
| What the client sees | World A | World B |
|---|---|---|
| no reply within 1 s | node crashed before applying | node applied, then paused 3 s |
| no reply within 1 s | request dropped in flight | reply dropped in flight |
| no reply within 1 s | node partitioned from client | node alive, partitioned from client only |
Every row is the same bytes on the wire.
Worked trace: a write that may or may not have happened
Counter service, client C, nodes N and M. C sends INCR counter by 1 with a 1 s deadline.
- t=10 ms: N receives, applies, counter 41 → 42.
- t=15 ms: N enters a 3 s stop-the-world GC pause before writing the reply.
- t=1000 ms: C's deadline fires. C has no reply. C declares N failed.
- t=1000 ms: C retries to M. M applies, counter 42 → 43.
- t=3010 ms: N wakes and sends its reply. C has already given up and discards it.
Final counter 43. One increment was intended. The client cannot tell this from the case where N crashed at t=5 ms and only M's increment landed (counter 42): both look like "no reply in 1 s, then a retry succeeded."
That is the whole problem in one trace: the timeout is a decision, and the decision is sometimes wrong in both directions.
What the numbers look like
- TCP connect:
net.ipv4.tcp_syn_retriesdefaults to 6, roughly 127 s before connect gives up. That is the kernel's guess, not a fact about the peer. - etcd/Raft:
--heartbeat-interval=100ms,--election-timeout=1000ms. A leader that misses heartbeats for 1 s is replaced; a leader in a 1.2 s pause is replaced too, and may come back still believing it leads. - Kubernetes:
--node-monitor-period=5s,--node-monitor-grace-period=40s. A node is markedNotReadyafter 40 s of missed heartbeats; pods get thenode.kubernetes.io/unreachabletaint withtolerationSeconds: 300before eviction. Those are chosen thresholds, not measurements. - Cassandra's phi accrual detector (
phi_convict_threshold, default 8) makes the same trade with a continuous score instead of a fixed timer.
What you do about it
Since you cannot detect failure, you contain being wrong about it:
- Fencing tokens: every write carries a monotonically increasing token; storage rejects any token lower than the highest seen, so a resurrected node's stale writes are refused.
- Idempotency keys: the retry in the trace above carries the same key, so M's apply is a no-op if N already applied it.
- Quorums: a node that cannot reach a majority stops serving, so a partitioned minority cannot act alone.
The design goal is not a better failure detector. It is making a wrong failure decision survivable.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.