Highlights

Contents

Part VIII
08

Case study: one incident

We now follow one fault across admission, state, traffic, and restoration. Every recovery mechanism must preserve the same operation contract rather than creating a new failure elsewhere. We will reconcile the capacity, timing, and data guarantees and identify what each component contributes.

CHAPTER ATLAS / FOLLOW THE READING PATHCHAPTER ATLAS / FOLLOW THE READING PATH1Availability and SPOFs2Redundancy,active-active, passive3Graceful degradation andfault tolerance4Retries, exponentialbackoff, and jitter5Timeouts, circuitbreakers, bulkheads6Health checks andfailover7Disaster recovery, RTO,and RPO8Case study: one incident

#Section 29Before the incident

Heron’s illustrative application variant has four replicas with a combined assumed capacity of 1,400 requests per second. Its peak is 1,000, leaving 400 of normal headroom. Required score reads have a deadline, optional recommendations have a separate bounded pool, and commands retain their identities with their committed effects.

The database has safe write ownership and recoverable history. Cache reads use the declared freshness rule. Health probes distinguish inability to accept new work from a process needing restart. These mechanisms must already be active; installing them while an incident is underway changes the system during diagnosis.

NORMAL CONTRACT: 4 × 350 = 1,400/S FOR A 1,000/S PEAK, CLIPS ISOLATED IN 20 SLOTSNORMAL CONTRACT: 4 × 350 = 1,400/S FOR A 1,000/S PEAK, CLIPS ISOLATED IN 20 SLOTS1,400/s capacity400/s spare at peakclip calls: 20 slotscommands carry stable identitywrite the normal contract first; failure plans build on it
Figure 11.35Assumed reliability variant of Heron. Capacity figures require workload-specific tests.

Use a failure matrix to say which incident is covered by which mechanism. Losing a worker needs routing and survivor capacity. Losing a writer needs recovery and fencing. Losing a region needs its own service and recovery plan. A bad global credential rollout can defeat several of these paths together.

#Section 30During the incident

One replica disappears. The healthy fleet has 1,050 requests per second of assumed capacity, only 50 above original peak demand. If 5% of requests launch an additional speculative attempt, total demand becomes 1,050. Hedging sends an extra eligible attempt before the original finishes to reduce a long-tail wait.

That arithmetic shows why hedging belongs inside a capacity budget. It can help a read waiting on an unusually slow independent path, but it can worsen a fleet-wide slowdown. It also needs cancellation and safe semantics. Do not hedge a non-idempotent write merely because its reply is late.

AFTER ONE LOSS, 5% HEDGED READS FILL THE LAST 50/S OF 1,050 CAPACITYAFTER ONE LOSS, 5% HEDGED READS FILL THE LAST 50/S OF 1,050 CAPACITYoriginal demand 1,000/shedges 50/scapacity 3 × 350 = 1,050/sno margin left; a fleet-wide slowdown makes hedges pure extra load
Figure 11.36Illustrative admission arithmetic. Correlated slowness can make speculative attempts unhelpful.

If usable capacity falls further, admit less work and serve only permitted degraded responses. Keep state-changing commands protected by the same identity and authority checks. Observe original demand separately from attempts; otherwise a retry surge looks like new user interest and can mislead routing or scaling decisions.

#Section 31Returning safely

The dependency answers a probe, but its cache is cold and its database pool is rebuilding. Open traffic gradually. An illustrative canary receives 5% of 1,000 peak requests per second, or 50, while the established path carries 950. Compare correctness, latency, and resource saturation before increasing the share.

A canary is a limited exposure used to observe a changed or recovered path before wider rollout. It does not prove the full workload fits, especially for hot keys, connection limits, or traffic that only appears at a larger share. Its job is to reduce exposure while collecting relevant evidence.

RETURN 5% FIRST: 50/S TO THE RECOVERED PATH, 950/S STAYS ON THE OLDRETURN 5% FIRST: 50/S TO THE RECOVERED PATH, 950/S STAYS ON THE OLDeach = 50/sestablished 950/srecovered 50/sinspect outcomes, then widen; a small share proves little about full load
Figure 11.37Illustrative canary split. Full-capacity testing remains separate from this limited exposure.

Do not clear a backlog by flooding the recovering database. Recovered queues use net spare capacity, and retries keep their budgets. Reconcile any uncertain command before declaring it failed or repeating it with a new identity. The incident ends when the chosen user operation meets its contract, not when every dashboard turns green independently.

#Section 32What each mechanism contributes

At the whiteboard, explain a score correction during a worker loss. Admission keeps the request inside capacity, the deadline bounds waiting, the database commits the command and identity together, and the retry owner recovers the result. Health checks move new work; fencing prevents an obsolete writer from changing authoritative state.

For a regional disaster, the recovery copy and retained log supply recoverable state. Verification establishes application invariants, and routing makes the restored capability reachable. In the illustrative drill the serial stages total 360 seconds against a 600-second objective; the data gap must be measured independently against the RPO.

FOUR MECHANISMS, FOUR GUARANTEES; NONE SUBSTITUTES FOR ANOTHERFOUR MECHANISMS, FOUR GUARANTEES; NONE SUBSTITUTES FOR ANOTHERadmission + bulkheadbound resourcesdeadline + retrybounded attempts, same idhealth + fencingroute and own safelybackup + restorerecover, verify, then serve
Figure 11.38Mechanism summary. These jobs fit together but are not interchangeable.
CAPACITY, RECOVERY TIME AND DATA LOSS ARE THREE SEPARATE CHECKSCAPACITY, RECOVERY TIME AND DATA LOSS ARE THREE SEPARATE CHECKSworker loss3 × 3501,050 req/sregional restore60 + 180 + 120360 ssnapshot gap300 × 206,000 eventshigh availability says nothing about how much data a restore loses
Figure 11.39Independent dimensions of the illustrative plan. A better result on one dimension does not establish the others.

This chapter has not supplied a consensus implementation or a product-specific backup policy. Those are boundaries to verify in the chosen system. The next unit turns admission from a general reliability rule into explicit per-user rate algorithms, including the races and failure modes of shared enforcement.