Try
↑ ↓ move↵ openesc close

Interview prep / Failure detection

Mid · Failure detection · System design interview question

What does it mean for a failure detector to be "unreliable but useful"? How weak can a detector be and still let a group reach consensus?

Sketch your own answer first, then compare it with the one below.

A strong answer

Chandra and Toueg described detectors by two properties. Completeness says every crashed node is eventually suspected by the live ones. Accuracy says live nodes are not wrongly suspected, in various strengths. A perfect detector has both, and cannot be built in an asynchronous system.

The useful result is that consensus does not need a perfect detector. It is enough that eventually, after some unknown time, there is at least one live node that nobody wrongly suspects any more. Before that point the protocol may stall, but it never produces a wrong answer.

In practice this is why protocols like Raft separate safety from liveness. Timeouts and heartbeats only affect when progress happens. Terms and majorities make sure that whatever happens is consistent.

Sources

Learn it by running it

The failure detection lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms