Try
↑ ↓ move↵ openesc close

Interview prep / Failure detection

Mid · Failure detection · System design interview question

A node on a congested link is marked dead, comes back, and is marked dead again every few seconds. Each transition triggers a rebalance. What do you do?

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

A strong answer

The detector is doing what it was asked to do. The trouble is that the reaction is wired directly to every change of state, so a marginal link produces a stream of rebalances, each of which moves data and adds load to a network that is already struggling.

Add asymmetry between going down and coming back. Declare a node dead after the usual timeout, but readmit it only after it has been healthy for a longer period, say a minute or several consecutive good intervals. This is hysteresis. Keep a count of recent transitions per node, and once it passes a threshold, quarantine the node instead of rebalancing again, and raise an alert for a person to look at.

Also cap the rate of reactions cluster-wide so that one bad node cannot churn the others. And consider separating the two states in the data path: a node that is suspected can stop receiving new work immediately, which is cheap and reversible, while moving its data only happens after it has been gone for a long time. Fast cheap reactions can follow the detector closely. Slow expensive ones should not.

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