Maps to: CMU 15-440/640 Spring 2026, learning outcome “failures in distributed systems: origins and empirical studies”. Readings: J. Gray, Why Do Computers Stop and What Can Be Done About It? (Tandem TR 85.7, 1985); D. Oppenheimer, A. Ganapathi and D. A. Patterson, Why Do Internet Services Fail, and What Can Be Done About It? (USITS 2003). Problem set: PS3 asks about failure arithmetic on flaky hardware and about classifying failures. This lecture teaches the concepts with different scenarios and numbers, and gives no answers. Sources:
- the two readings above;
- A. Avižienis, J.-C. Laprie, B. Randell and C. Landwehr, Basic Concepts and Taxonomy of Dependable and Secure Computing (IEEE TDSC 2004);
- B. Schroeder and G. Gibson, Disk Failures in the Real World (FAST 2007);
- Y. Huang, C. Kintala, N. Kolettis and N. D. Fulton, Software Rejuvenation (FTCS 1995);
- G. Candea and A. Fox, Crash-Only Software (HotOS 2003);
- K. S. Trivedi, Probability and Statistics with Reliability, Queuing, and Computer Science Applications (2nd ed., Wiley 2002).
The slides are not public; this is not a transcript. Every number not attributed to a paper comes from
code/lecture13/, run on the author’s machine (Apple M4 Pro, macOS, Python 3.13 and 3.9). All of it is exact computation or seeded simulation. Code:code/lecture13/. Reading time: ~80 minutes, plus ~5 to run the demos.
0. How to read this lecture
0.1 Learning goals
After this lecture you should be able to:
- Use the vocabulary of failure precisely: fault, error, failure; component vs service failure; reliability vs availability.
- Compute availability from MTTF and MTTR, convert it to nines and downtime, and explain why availability alone does not describe what users experience.
- State the exponential (memoryless) model, use its consequences (rates add), and recognize when it is wrong: infant mortality, wear-out and correlated failures.
- Compose availabilities in series, parallel and k-of-n, and explain why a redundant pair’s lifetime depends on the repair time and is capped by common-mode failures.
- Estimate the cost of a long job that needs many machines at once, and say what avoids the exponential cliff.
- Summarize what the empirical studies found (operators and software dominate; front ends and configuration matter), and read an incident log critically.
- Explain Bohrbugs vs Heisenbugs, why restart works, which process pairs help, and when rejuvenation pays.
0.2 Prerequisites and scope
- Prerequisites:
- Lecture 1: partial failure, and availability of n machines (demo 05);
- Lecture 4: what a client can and cannot know after a timeout;
- Lecture 11: M/M/k queues (used once, in §4.6);
- basic probability: expectation, the exponential distribution.
- Scope: how often and why things fail, and the arithmetic of redundancy and repair. How failures behave — fail-fast vs Byzantine — and the limits of tolerating them are Lecture 14. Saving progress (checkpoints, logs) is Lecture 15. Transactions are Lectures 16–18; replication is Lectures 19–22.
0.3 Section → code map
| Section | Idea | Demo in code/lecture13/ |
|---|---|---|
| §2 | MTTF, MTTR, nines | 01_availability_arithmetic.py (Part A) |
| §3 | memoryless and when it lies | 02_memoryless_and_when_it_lies.py |
| §4 | composition, redundancy, repair | 01_... (Parts B–D), 03_redundancy_and_repair.py |
| §5 | long jobs on flaky machines | 04_long_jobs_on_flaky_machines.py |
| §6 | what the studies found; reading a log | 05_incident_log.py |
| §7 | Heisenbugs, process pairs, restart, rejuvenation | 06_heisenbugs_and_restart.py |
| all | the toolkit | failures.py |
0.4 Notation
- MTTF — mean time to failure: the average length of an up period.
- MTTR — mean time to repair: the average length of a down period, from failure to service restored.
- MTBF — mean time between failures, = MTTF + MTTR. When MTTR ≪ MTTF the two are nearly equal; Gray and most practitioners use them interchangeably.
- Rates: λ = 1/MTTF is the failure rate; μ = 1/MTTR the repair rate.
- Availability A = fraction of time up. Unavailability 1 − A. “Nines” = −log₁₀(1 − A).
- Reliability R(t) = P(no failure in [0, t]); hazard h(t) = the instantaneous failure rate of a unit that has survived to age t.
- Times are in hours unless stated; a year is 8,766 hours.
1. Why study failures?
1.1 The intuition
Lecture 1 computed that a fleet of 100,000 machines, each failing about once every three years, loses a machine roughly every 16 minutes. At that scale failure is not an exception to design around; it is the normal state of the system. Something is always broken.
You cannot prevent failures. You can pull four levers:
- Fail less often — better parts, simpler software, fewer risky changes. This raises MTTF.
- Recover faster — detect quickly, restart automatically, keep spares ready. This lowers MTTR.
- Hide failures — redundancy, so that a component failure does not become a service failure (masking).
- Make failures smaller — partition the system, so that a failure hits some users, not all (containment).
This lecture is about measuring the effect of each lever and about evidence for which failures matter. The surprising answer from forty years of studies: the failures that matter most are not the ones engineers think about first. Hardware fails often but is easy to mask. People and software fail less often and are hard to mask.
1.2 The vocabulary
The dependability community distinguishes three things (Avižienis et al. 2004):
- A fault is the cause: a bug in a line of code, a cosmic ray, a wrong line in a configuration file, a worn bearing. A fault can sit latent (dormant) for years.
- An error is the part of the system’s state that is wrong because a fault was activated: a corrupted pointer, a bad entry in a routing table.
- A failure is an event visible at the interface: the service delivered deviates from what it should deliver.
A chain: a programmer writes <= instead of < (fault). On the first leap day the code runs and writes past an array (error). Three hours later, the server returns garbage to a user (failure). Fault tolerance is the art of stopping the chain before the last link.
The chain repeats at every level. One machine’s failure is a fault for the service built on it. Oppenheimer et al. make this explicit with two words that this lecture uses throughout:
- a component failure is a failure of one part (a disk, a node, an operator’s action);
- a service failure is a failure that users can see.
Redundancy exists to keep the first from becoming the second.
Gray (1985) adds a distinction that matters later. Availability is doing the right thing within the required response time. Reliability is not doing the wrong thing. A bank that refuses all transactions for an hour has an availability problem. A bank that silently credits the wrong account has a reliability problem, and it is far worse. Lecture 14’s “fail-fast” principle trades availability for reliability on purpose.
2. Measuring failure: MTTF, MTTR and nines
2.1 Availability
A repairable unit alternates between up periods and down periods. Over a long time the fraction of time it is up is
This holds for any distributions of up and down times with these means (the renewal-reward theorem), not only for exponential ones. Demo 01, Part A converts availabilities into downtime:
| availability | nines | down per year | per week |
|---|---|---|---|
| 99% | 2 | 3.7 days | 1.68 h |
| 99.9% | 3 | 8.77 h | 10.1 min |
| 99.99% | 4 | 52.6 min | 1.0 min |
| 99.999% | 5 | 5.3 min | 6 s |
Each nine is a factor of 10 in downtime and, usually, much more than 10 in cost.
Gray opens his paper with a “conventional, well-managed” transaction system of 1985. It fails about once every two weeks, and each failure snowballs into a 90-minute outage: minutes to notice, minutes to dump state, then restarts of the operating system, the database, the terminal network and the users’ work. The formula gives 336 / (336 + 1.5) = 99.56%, the paper’s “99.6%”. Gray’s point is that this sounds excellent and is not: about 39 hours a year of downtime, and outages tend to arrive at peak load. Note also where those 90 minutes go: the original problem takes minutes, and recovery takes the rest. A faster restart attacks the larger part.
2.2 The same availability, different systems
Availability depends only on the ratio MTTR/MTTF. Demo 01 builds three systems with exactly the same 99.41%:
| system | outages per year | each lasts |
|---|---|---|
| A | 52 | 1 h |
| B | 5 | 10 h |
| C | 363 | 8.6 min |
They are not equivalent:
- For an online store, C’s frequent short blips may be invisible: clients retry and users barely notice.
- For a hospital, B’s ten-hour outages are dangerous.
- For a stateful job, each of C’s 363 failures may lose work in progress (§5).
So describe a system by both numbers: how often it fails and how long it stays down, not only their ratio.
The ratio has a happy consequence. Making failures 10× rarer and making repairs 10× faster buy exactly the same availability. Demo 01 Part B prints both columns for every layer of a toy service, and they agree to the last digit. Repair is often the cheaper lever. A watchdog that restarts a process in 30 seconds is easier to build than a process that never crashes. This is the idea behind recovery-oriented computing (§7.6).
2.3 Error budgets
Modern operations teams turn availability into a budget. A 99.5% service-level objective (SLO) allows 0.5% × 8,766 h ≈ 43.8 hours of user-visible failure a year. A team that has spent little of its budget can take risks (deploy faster). A team that has spent most of it should slow down. The budget converts an abstract percentage into hours that engineers can reason about. Demo 05 computes one from an incident log (§6.4).
3. The exponential model, and when it lies
3.1 Memoryless lifetimes
The simplest model of a lifetime X is the exponential distribution with rate λ:
Its defining property is that it is memoryless:
A unit that has survived to age s is, statistically, as good as new. Equivalently, its hazard — the failure rate of a survivor — is constant: h(t) = λ. So its expected remaining life is always the full mean, however long it has already run.
Three consequences make the exponential the workhorse of reliability arithmetic:
- Rates add. If n independent units have exponential lifetimes with rates λ₁ … λₙ, the time until the first failure is exponential with rate λ₁ + … + λₙ. A fleet of n identical machines has a failure every MTTF/n on average.
- Failures form a Poisson process. The number of failures in an interval has a Poisson distribution, and failures in disjoint intervals are independent.
- Markov models work. Because the past does not matter, a system’s future depends only on which units are up now. Small Markov chains (§4.3) then give exact answers.
The model is also a claim about the world, and the claim is often false for single units. Demo 02 shows three ways.
3.2 Infant mortality and wear-out
The Weibull distribution, with survival function S(t) = exp(−(t/η)^k), has a hazard that changes with age according to its shape k:
- k < 1: a decreasing hazard, or infant mortality. Weak units die early, and survivors are better than new.
- k = 1: the exponential.
- k > 1: an increasing hazard, or wear-out. Old units are worse than new.
Demo 02 Part A prints the expected remaining life of a unit that has already survived t hours, for five distributions with the same 1,000-hour mean:
| lifetime | age 0 | age 1,000 h | age 4,000 h |
|---|---|---|---|
| Weibull k = 0.5 | 1,000 h | 2,414 h | 3,828 h |
| exponential | 1,000 h | 1,000 h | 1,000 h |
| Weibull k = 3 | 1,000 h | 300 h | 29 h |
(A Monte Carlo check of 200,000 lifetimes agrees with the exact values within 0.5%.) Under infant mortality, a server that has run for months is more trustworthy than a new one. Under wear-out it is due for replacement. Only under the exponential does age not matter at all. Before applying the memoryless property to a real component, ask whether its failures are random or age-related.
Real populations mix both. Part B builds a bathtub curve: 5% weak units with infant mortality, and strong units that fail at random (mean 20 years) or wear out (mean 6 years). The hazard is 3.9 failures per unit-year in the first day, falls to 0.058 per unit-year in year 2, and climbs back to 0.625 in year 7.
Burn-in — running new units in the factory before shipping — moves the infant failures from customers to the factory. The demo shows its limits:
- 168 hours of burn-in costs 2.8% of the units and cuts first-year field failures from 9.7% to 7.2%;
- even 2,000 hours leaves 5.2%, because no burn-in can go below the 4.9% floor of random and wear-out failures.
Gray saw the product-level version of infant mortality. About one third of the Tandem outages came from products still “having the bugs shaken out” — new hardware or software releases. Hence his advice: avoid the “bleeding edge”.
3.3 Fleets look Poisson anyway
Here is the good news. Demo 02 Part C simulates 1,000 machines whose lifetimes wear out strongly (Weibull k = 3: the gaps between one machine’s failures are quite regular, with a coefficient of variation of 0.36). Each failed machine is replaced by a new one. The fleet’s failures look exactly like a Poisson process:
- the coefficient of variation of the gaps between failures is 1.00 (exponential: 1);
- the variance-to-mean ratio of hourly counts is 0.99 (Poisson: 1).
This is the superposition theorem (Palm–Khintchine): merging many independent renewal processes gives, approximately, a Poisson process. It is why the exponential model works well for questions about a large fleet — how often something fails, how many spares to keep — even when it is wrong for each machine.
3.4 Correlated failures break everything
The superposition argument needs independence, and real failures are often correlated: a power distribution unit fails, a top-of-rack switch dies, a bad firmware update reaches every disk of one model, an operator runs the wrong command on every machine at once. Part C adds rack-wide events to the same fleet: 25 racks of 40 machines, one event per rack every two years. That adds only about 3% more failures, but their clustering changes:
| fleet | variance / mean of hourly counts | hours with ≥ 10 failures | Poisson model predicts |
|---|---|---|---|
| independent machines | 0.99 | 0 | 0.0027 |
| + rack events | 2.86 | 30 | 0.0034 |
A model that assumes independence underestimates the chance of a burst of failures by four orders of magnitude here. Bursts are what defeat redundancy: two replicas in the same rack fail together. This is why real systems spread replicas across failure domains (racks, power feeds, buildings, regions; Lecture 25), and why §4.5 puts a ceiling on what redundancy buys.
Field studies of real hardware found the same deviations from the textbook model. Schroeder and Gibson (2007) studied disk replacement logs from large installations. As they report:
- annual replacement rates were typically 2–4% and sometimes much higher, several times the rates implied by datasheet MTTFs;
- replacement rates rose steadily with age rather than staying flat;
- replacements were correlated in time: a disk failure made another one soon more likely.
The exponential model is a starting point, not a fact.
4. Composition: series, parallel, repair
4.1 Series and parallel
If a service needs all of n independent parts (a chain of tiers, every shard of a database), availabilities multiply:
If any one of n copies suffices, unavailabilities multiply:
More generally, if k of n identical parts must be up (a web tier that needs 4 of 6 servers for capacity, a quorum that needs 3 of 5), the unavailability is a binomial tail,
which failures.k_of_n_unavailability sums in log space, so that 10⁻¹⁵ does not round to zero.
Demo 01 Part B builds a toy web service as a chain of seven layers: an external DNS provider, a pair of load balancers, 4-of-6 web servers, 6-of-8 application servers, a database with a standby, a single core switch, and the configuration/deployment pipeline modelled as one more component (a bad push every two months, 1.5 hours to roll back). The service is 99.85% available, about 13 hours a year down. Where does the downtime come from?
| layer | redundancy | down per year |
|---|---|---|
| config / deploy pushes | single | 539 min |
| core network switch | single | 180 min |
| DNS provider | single | 54 min |
| database primary + standby | 1 of 2 | 3.7 min |
| load balancers | 1 of 2 | 2.1 min |
| web servers | 4 of 6 | 0.1 min |
| application servers | 6 of 8 | 0.1 min |
The tiers with the most machines contribute almost nothing. The three non-redundant layers cause 99% of the downtime, and the human process of changing the system alone causes 69%. Adding a third database copy would save 3.7 minutes a year. In series, the weakest unmasked part decides. Spend the next engineering hour there. (This is the availability version of Lecture 11’s bottleneck law.)
4.2 Available to whom?
“Availability” needs a definition of success. Part C of demo 01 takes 100 shards, each 99.9% available:
- a request that needs one shard succeeds 99.9% of the time;
- a request that touches 10 shards succeeds 99.0% of the time (fan-out again, as in Lecture 2’s tail at scale);
- “all 100 shards are up” holds only 90.5% of the time.
The same system is “three nines” or “one nine” depending on which question you ask. Gray proposed weighting availability by the fraction of users and data affected: if 90% of the database is reachable from 90% of the terminals, the system is 0.9 × 0.9 = 81% available. Demo 05 reports both the binary and the user-weighted availability of a log.
4.3 Redundancy only works with repair
A pair of mirrored copies fails when the second copy dies while the first is still being repaired. Intuition first. Each copy fails at rate λ, so the pair sees a first failure about every 1/(2λ). That failure opens a window of vulnerability of length about MTTR. The pair dies if the survivor fails in that window, which happens with probability ≈ λ · MTTR. So pair failures come about every
The exact answer comes from a three-state Markov chain (two copies up, one up, none up). It gives (3λ + μ)/(2λ²) and is computed in failures.pair_mttf. The rule of thumb has two lessons:
- Redundancy squares the MTTF: a second copy is enormously valuable.
- It divides by the repair time: a second copy is only as good as the speed of repair. A replica that nobody replaces after a failure buys almost nothing.
Gray’s example: discs with an MTTF above 10,000 hours (a hard fault about once a year), mirrored, with a “leisurely” 24-hour repair. Demo 03 Part A computes this pair three ways:
| method | pair MTTF |
|---|---|
| rule of thumb MTTF²/(2 MTTR) | 238 years |
| exact Markov model | 239 years |
| simulation (1,500 histories) | 236 ± 12 years |
Gray wrote “over 1000 years”. With exactly 10,000-hour discs and 24-hour repairs, that would need discs of about 20,500 hours (his “above 10,000 hours” allows it). His own field data are better still: 7 duplexed-disc failures in 10⁸ disc-hours (paper’s numbers), one per 815 years per pair. We report all three numbers rather than pretend to reproduce one.
Part B varies the repair time with discs fixed at 10,000 hours:
| MTTR | pair MTTF | gain over one disc |
|---|---|---|
| 1 hour | 5,706 years | 5,002× |
| 24 hours | 239 years | 210× |
| 7 days | 36 years | 31× |
| 30 days | 10 years | 8× |
This is why large storage systems put so much effort into fast re-replication after a disk dies (Lecture 25). The repair time is part of the redundancy.
Does the shape of the repair-time distribution matter, or only its mean? Part C keeps the mean and changes the shape: fixed, exponential, or heavy-tailed lognormal repairs. The pair dies only if the survivor fails during a repair. With exponential lifetimes the exact answer is
where R is a repair time. For short repairs p ≈ λ·E[R] and only the mean matters: 51,250 / 51,500 / 53,348 hours for the three shapes at a 10-hour mean. For long repairs, variable repairs are slightly better (3,784 vs 2,929 hours at a 300-hour mean). Most heavy-tailed repairs are short, and a short repair leaves little time for the second failure. Our first guess, that variability would hurt, was wrong.
4.4 Ceilings: common-mode failures and the rest of the system
The square law assumes the two copies fail independently. A common-mode failure takes both down at once: one power feed, one firmware bug, one operator, one fire. In the simple beta-factor model, a fraction β of each unit’s failure rate is common-mode. Demo 03 Part D:
| common-mode share β | pair MTTF | ceiling 1/(βλ) |
|---|---|---|
| 0 | 239 years | ∞ |
| 0.1% | 198 years | 1,141 years |
| 1% | 78 years | 114 years |
| 10% | 11 years | 11 years |
Even 1% of shared causes cuts the pair’s life by two thirds. At 10% the pair is barely better than one disc’s common-mode rate. Independence is the expensive part of redundancy: different racks, power, software versions, administrators.
The second ceiling is the rest of the system. Gray explains why Tandem built process pairs rather than triples: other parts of the system, above all operators, are orders of magnitude less reliable. Part D models modules that fail once a year with 1-hour repairs, in series with operators who take the system down every 31 years (Gray’s administrative MTBF):
| copies of the module | module group MTTF | whole system MTTF |
|---|---|---|
| 1 | 0.97 years | 0.97 years |
| 2 | 4,384 years | 30.78 years |
| 3 | 26 million years | 31.00 years |
The third copy is wasted. Redundancy should stop where another failure cause dominates.
4.5 Repair crews and quorums
Lectures 19–21 use quorums: a majority of 5 replicas must be up. Demo 03 Part E computes a 3-of-5 group with a limited number of repair crews: technicians, or re-replication bandwidth. Two units can be broken at once, and with one crew the second waits for the first to be fixed. With 24-hour repairs and unit MTTF 1,000 hours:
- the quorum’s MTTF falls from 8 years (five crews) to 4 years (one crew);
- its unavailability rises 6.2×.
Correlated bursts of failure make queues for repair. A system’s repair capacity must be sized for bursts, not for averages.
4.6 Failures also remove capacity
Not every failure is an outage. Often it is lost capacity. Part D of demo 01 joins this lecture with Lecture 11. A service receives 4,000 requests/s of 20 ms each. To keep the mean response time below 25 ms, the M/M/k formula says 83 servers must be up. Each server is up 99% of the time, independently (MTTF 990 h, MTTR 10 h). How many servers to deploy?
| servers | spares | P(at least 83 up) |
|---|---|---|
| 83 | 0 | 43.4% |
| 85 | 2 | 94.6% |
| 88 | 5 | 99.97% |
| 90 | 7 | 99.9996% |
Running exactly at the computed size means running short of capacity more than half the time. Five spares (6%) give 99.9%; seven give 99.999%. This is “N + k” provisioning. The spares cover the average number of servers down (1% of N) plus a margin for random fluctuations that grows like √N, as in Lecture 11’s staffing rule. Correlated failures (a rack of 40 at once) would need a much bigger reserve.
5. Long jobs on flaky machines
5.1 The job’s failure rate grows with its size
Some computations need every machine to stay up: a tightly coupled simulation, a large training run with synchronous steps, a distributed transaction holding locks. If n machines each fail at rate λ₀ = 1/M, the job is interrupted at rate λ = n/M (rates add, §3.1). The job’s own MTTF is M/n: 1,000-hour machines give a 1,000-machine job a failure every hour.
Suppose the job needs T hours of uninterrupted work, and a failure loses all progress: the job restarts from scratch after a recovery delay R. Each attempt succeeds with probability e^{−λT}. To find the expected completion time E, condition on the first failure time X:
- if X ≥ T (probability e^{−λT}), we are done after T;
- otherwise we lost X, pay R, and face the same problem again.
Solving E = E[min(X, T)] + P(X < T)(R + E) gives
For small λT this is close to T, with a relative overhead of about λT/2. For large λT it grows exponentially.
5.2 The cliff
Demo 04 runs a 10-hour job on n machines with MTTF 1,000 hours each and a 15-minute recovery delay (formula, checked by simulation within 2%):
| machines | MTTF of the set | P(no failure in 10 h) | expected completion |
|---|---|---|---|
| 1 | 41.7 days | 99.0% | 10.05 h |
| 10 | 4.2 days | 90.5% | 10.54 h |
| 100 | 10 h | 36.8% | 17.6 h |
| 300 | 3.3 h | 5.0% | 2.8 days |
| 1,000 | 1 h | 0.005% | 3 years |
Ten hours of work on a thousand machines takes three years. Part B tabulates E/T = (e^x − 1)/x against x = λT, the expected number of failures during one attempt: 1.05 at 0.1, 1.72 at 1, 29 at 5, 2,203 at 10, 24 million at 20. The cliff is at λT ≈ 1. Below it, restart-from-scratch costs little. Beyond it, the job essentially never finishes.
5.3 What helps
Part C asks what helps the 1,000-machine job:
| strategy | expected completion |
|---|---|
| tightly coupled, restart from scratch | 3 years |
| machines 10× more reliable (MTTF 10,000 h) | 17.6 h |
| checkpoint every 24 min (5-minute checkpoints) | 19.4 h |
| 10× better machines + checkpoints | 11.7 h |
| 1,000 independent 10-hour tasks, each restarted alone | 19.4 h |
| 10,000 independent 1-hour tasks | 11.2 h |
Three ideas come out of this table, and the rest of the course develops them:
- Save progress. A checkpoint turns one long job into many short ones, each restarted from the last checkpoint. That keeps λ × (segment length) below the cliff. Lecture 15 finds the best interval: Young’s rule τ ≈ √(2C/λ) gave 24 minutes here.
- Decouple. If a failure only re-executes the piece that was running on the failed machine, the job’s failure rate no longer grows with n. This is MapReduce’s design (Lecture 24): small, independent, re-executable tasks. Splitting the work into 1-hour tasks brought the job to 1.11× its failure-free time.
- Better hardware alone does not scale. A 10× improvement moved the cliff by 10×; the next 10× growth in job size undoes it.
The general lesson: at scale, do not make a long computation depend on every machine staying up.
6. What actually fails: the empirical studies
Arithmetic needs inputs. What fails in real systems, and for what reasons?
6.1 Gray 1985: a fault-tolerant system’s failures
Jim Gray analysed the failures reported to Tandem, a maker of fault-tolerant “NonStop” systems built from duplicated, fail-fast modules. The sample, in the paper’s numbers:
- over 2,000 systems and more than 10 million system-hours (about 1,300 system-years) over seven months;
- 166 reported failures, including one fire and one flood;
- a system MTBF of 7.8 years as reported (Gray estimated about 50% under-reporting, so perhaps half that), against weeks for conventional systems.
Fault tolerance worked: more than two orders of magnitude better.
Gray then removed the infant-mortality failures (about a third, from products still being debugged) and the non-duplexed discs. That left 107 failures, classified like this (paper’s Table 1):
| cause | share | MTBF |
|---|---|---|
| administration (maintenance, operations, configuration) | 42% | 31 years |
| software (vendor and application) | 25% | 50 years |
| hardware | 18% | 73 years |
| environment (power, communications, facilities) | 14% | 87 years |
Gray drew five lessons from the data:
- Hardware fault tolerance works. About 50,000 hardware faults occurred in the sample, and fewer than one in a thousand caused an outage. Duplexed discs achieved a pair MTBF above 5 million hours.
- People and software dominate the rest. Administrators made a critical mistake about once every 31 years per system. They were very careful; the system was mostly tolerant of their errors; and still administration was the largest cause. Gray concluded that the top priority is to reduce human intervention: self-configuring systems, simple and consistent operator interfaces, maintenance procedures that tolerate mistakes.
- Change is dangerous, and so is not changing. New products caused a third of all outages and maintenance a third of the rest, yet many outages came from known bugs whose fixes had not been installed. Gray’s resolution distinguished hardware from software:
- install hardware fixes promptly;
- install a software fix only if its bug is causing outages, otherwise wait for a major, well-tested release.
- Avoid the bleeding edge.
- Software fault tolerance is the next frontier. That is §7.
6.2 Oppenheimer, Ganapathi and Patterson 2003: Internet services
Eighteen years later, the high-availability frontier had moved from fault-tolerant mainframes to large Internet services built from commodity machines. Oppenheimer et al. studied the problem-tracking databases and post-mortem reports of three services (their numbers):
| service | size | data |
|---|---|---|
| “Online”, a mature portal | ~500 machines | 296 component and 40 service failures in 7 months |
| “Content”, a young content-hosting service | ~500 machines | 205 component and 56 service failures in 3 months |
| “ReadMostly”, a mature read-mostly service | >2,000 machines | 21 service failures in 6 months |
Their architecture is the one in this course: a load-balancing tier, a stateless front-end tier, and a back end that stores persistent data. The headline findings:
- Operator error was the largest cause of service failures in two of the three services. It was also the largest contributor to time to repair: operator errors accounted for about 75% of all TTR hours in Online and Content.
- Configuration errors were the largest category of operator error. More than half of the operator errors that caused service failures were configuration mistakes, and in one service nearly all of them. They happened mostly during normal maintenance — scaling, replacing hardware, deploying software — not while fixing other problems.
- Operator errors are hard to mask. At Content, half of the operator errors became service failures, against 24% or fewer of other component failures. Operators act on files that affect the whole service or a whole partition (configuration, content), so redundancy does not help. The authors stress that operator errors were not more frequent than hardware or software failures. They were less often masked.
- The front end mattered. Contrary to conventional wisdom, more than half of the service failures in Online and Content had their root cause in front-end machines (77% and 66%), largely through configuration errors in custom software. At ReadMostly, with simpler, better-tested software and fewer daily changes, 76% of service failures were network problems instead. Networks were often single points of failure, and “redundant” links sometimes shared a physical path.
- What would have helped? For 40 service failures at Online, the authors asked which techniques could have prevented or shortened them. More online correctness testing was the most useful (26 of the 40 failures). Next came better exposing and monitoring of failures (11–12), more redundancy (9), configuration checking (9), and online fault and load injection (6). Redundancy and monitoring offered the most benefit for their cost.
The two studies agree across eighteen years and very different technology. Hardware is the solved problem; the people who change the system and the software they deploy are the unsolved one.
6.3 Reading an incident log (demo 05)
To practise the method, demo 05 generates one year of incidents for a toy three-tier service. Each cause has a rate of component failures, a probability that redundancy masks it, detection and repair times, and the share of users it hits. The demo prints these assumptions. They were chosen to resemble the shape of the studies above, so “operators dominate” is an input here, not a discovery. What the demo shows is how the answer depends on what you count:
| cause | share of component failures | share of service failures | share of outage hours |
|---|---|---|---|
| hardware | 44% | 12% | 11% |
| software | 35% | 20% | 7% |
| operator | 7% | 32% | 50% |
| network | 12% | 28% | 14% |
By count of component failures, hardware is the problem. By outage hours, operator errors are. Only 8% of the 307 component failures got through to users, but those 25 service failures cost 2.2 days of outage. Availability was 99.39% counting every outage as total, and 99.61% weighted by the users affected; the year used 78% of a 99.5% SLO’s budget.
Replaying the same year with one change at a time (Part C) ranks the remedies:
| change | user-weighted hours saved per year |
|---|---|
| configuration checking catches 70% of operator errors | 11.9 |
| tools halve the repair time of operator errors | 6.8 |
| redundant network paths mask 80% of network failures | 5.0 |
| monitoring halves every detection time | 1.9 |
| 10× more reliable hardware | 0.8 |
What fails most often is not what costs most.
Finally, Part D asks how much one year of data proves. The bootstrap interval from the seeded year (99.04–99.69%) misses the toy world’s long-run mean (98.89%). Outage lengths are heavy-tailed, the year happened to have no very long outage, and a bootstrap cannot invent outages longer than those it saw. Independent simulated years ranged from 98.11% to 99.43%; a 10-year log gave 98.96%. With a few dozen outages a year, one year’s availability is a rough estimate. Be wary of “we improved from 99.5% to 99.7%” based on one year each.
7. What to do about it: Gray’s recipe for software fault tolerance
7.1 Modularity and fail-fast modules
Von Neumann showed in 1956 how to build reliable machines from unreliable parts. His construction needed a redundancy factor of about 20,000 for a system MTBF of 100 years (paper’s numbers). Tandem used a factor of 2. Gray’s explanation: von Neumann’s design had redundancy without modularity, so a fault anywhere could bring down the whole system. Modern systems are built from modules that are units of failure and of replacement, and each module is fail-fast: it either works correctly or stops. Gray’s recipe for hardware:
- decompose the system hierarchically into modules;
- give each module an MTBF of more than a year;
- make each module fail-fast;
- detect a module’s failure promptly, from the failure signal or from missing “I am alive” messages (heartbeats);
- keep spare modules that take over within seconds.
Gray applies the same recipe to software. Processes that share no memory and talk only by messages are the modules. Each process checks its inputs, intermediate results and data structures, and stops at the first inconsistency. Lecture 14 develops fail-fast in detail. Its value is that it turns a wrong answer (a reliability failure) into a stop (an availability failure) that redundancy can mask.
7.2 Bohrbugs and Heisenbugs
Why would a backup process succeed where the primary failed, if both run the same code? Gray’s answer is the Heisenbug hypothesis: most faults in production software are soft.
- Software that has been through design reviews, testing and months of production has lost most of its Bohrbugs: solid, reproducible bugs that fail every time on the same input.
- What remains are Heisenbugs, which depend on rare circumstances: a race condition, a resource limit reached, a transient device error, a lost interrupt. Re-run the operation in a fresh state and it usually works, because the environment is slightly different.
Gray’s one experiment (paper’s numbers): in the error logs of a spooler built from fail-fast process pairs, where a failed process’s brother retries the operation, only 1 of 132 software faults was a Bohrbug. A study of IBM’s MVS found that recovery routines succeeded in about 76% of attempts, extending system software MTBF by a factor of 4.
The engineering conclusion is surprisingly practical: restart is a cure. Detect the failure, reset the process to a clean state, and try again.
7.3 Process pairs
A process pair is a primary process and a backup on another processor that takes over when the primary fails. Gray compares five designs:
| design | how the backup keeps up | hardware faults | Heisenbugs | programming effort |
|---|---|---|---|---|
| lockstep | executes the same instructions simultaneously | tolerated | not tolerated: both fail identically | none |
| state checkpointing | primary sends state changes before each major event | tolerated | tolerated | hard |
| automatic checkpointing | the kernel saves all messages and replays them to the backup (Borg et al., Lecture 15) | tolerated | tolerated | none, but much data |
| delta checkpointing | primary sends logical updates | tolerated | tolerated | hard, efficient |
| persistent | backup starts with amnesia; only session open/close is saved | tolerated | tolerated | easy, but state is lost |
Gray’s preferred combination is persistent process pairs plus transactions. The backup forgets the in-flight work, and the transaction mechanism aborts everything the failed primary had not committed. The inputs are then re-executed from scratch. Lectures 16–18 build that mechanism.
7.4 Demo 06: five recovery strategies for one year of failures
Demo 06 Part A simulates one year of failure events for a service. The assumptions:
- hardware: one processor failure every 60 days;
- Heisenbugs: one crash every 3 days, and a re-executed request hits the bug again with probability 1%;
- Bohrbugs: a rare poison request whose input crashes any process that executes it, one every 60 days. That is still about 20× more Bohrbugs per Heisenbug than Gray saw, so that their effect is visible.
Each strategy turns each event into an outage:
| strategy | downtime | availability | from Heisenbugs | from poison |
|---|---|---|---|---|
| single process, operator restarts (Gray’s 90 min) | 9.8 days | 97.31% | 8.8 days | 13.5 h |
| single process + watchdog restart (30 s) | 16.0 h | 99.82% | 1.17 h | 13.5 h |
| lockstep pair + watchdog | 14.7 h | 99.83% | 1.17 h | 13.5 h |
| checkpointing pair (backup re-executes) | 13.6 h | 99.84% | 7.5 min | 13.5 h |
| checkpointing pair + quarantine | 13.0 min | 99.9975% | 7.5 min | 5.0 min |
The table follows Gray’s argument step by step:
- Automatic restart is the largest single improvement. Most failures are Heisenbugs, a restart cures them, and a watchdog cuts each outage from 90 minutes to 30 seconds.
- A lockstep pair removes hardware downtime but keeps every Heisenbug outage, because the twins fail together.
- A checkpointing pair hides Heisenbugs too: the backup re-executes the request in its own environment.
- Then the Bohrbugs dominate. A poison request in a persistent input queue causes a crash loop: every restarted process picks it up and crashes again, until a person removes it. Nothing that re-executes the same input can tolerate a deterministic bug. The input must be set aside. Production systems quarantine a request that has crashed the server twice (a “dead-letter queue”). With quarantine, availability goes from 99.84% to 99.9975%.
7.5 Restart as a design principle
If restart is the cure, make it cheap and safe. Candea and Fox’s crash-only software (2003) takes this to its conclusion. Design every component so that the only way to stop it is to crash it, and the only way to start it is to recover. Recovery code is then exercised constantly instead of rarely. They later showed microreboots: restarting a single component instead of the whole application server, which in their experiments recovered roughly an order of magnitude faster. The prerequisites are exactly what this course builds:
- state kept outside the process, in stores that survive crashes (Lectures 15–17);
- requests that are idempotent or deduplicated, so that retries are safe (Lecture 4);
- clients that retry with backoff (Lecture 4).
7.6 Software aging and rejuvenation
Some faults accumulate: memory leaks, fragmentation, file-descriptor leaks, growing caches. A long-running process becomes more likely to crash the longer it runs — wear-out in software. Huang et al. (1995) proposed rejuvenation: restart the process on purpose, at a convenient time, before it crashes. A planned restart costs a short, scheduled outage (or none, if a pair or a load balancer hides it). An unplanned crash costs a long one.
Demo 06 Part B models a process whose mean time to crash is 30 days. A crash costs 90 minutes and a planned restart 1 minute. Renewal-reward gives the availability for a restart every τ, and a simulation agrees to five digits (99.98116% vs 99.98101%):
| time to crash | never restart | best τ | availability at best τ |
|---|---|---|---|
| exponential | 99.7921% | never | 99.7921% |
| Weibull k = 2 | 99.7921% | 3.5 days | 99.9613% |
| Weibull k = 4 | 99.7921% | ~8 days | 99.9887% |
Rejuvenation never helps a memoryless process: a restarted process is no better than the old one, and the restart only adds downtime. With wear-out, restarting every 8 days removes about 95% of the downtime. Whether rejuvenation pays is a question about the hazard function, §3 again.
7.7 Recovery-oriented computing
§2.2 showed that availability depends only on MTTR/MTTF, and §6 that the dominant failures — operator and software errors — are the ones that are hardest to prevent. Patterson, Fox and colleagues drew the conclusion in the recovery-oriented computing project: accept that failures will happen and make recovery fast, automatic and safe. Their methods:
- undo for operators;
- configuration checking;
- online testing and fault injection, the ancestor of today’s “chaos engineering”;
- better monitoring to cut detection time;
- partitioning to shrink the blast radius.
The two readings in this lecture are, in effect, that project’s motivation.
8. Design rules
- Describe failures with two numbers: how often (MTTF) and how long (MTTR), plus who is affected.
- Find the unmasked parts first. In series, the weakest non-redundant component — often the change process — decides availability.
- Redundancy needs repair. A second copy squares the MTTF only if a failed copy is replaced quickly. Budget repair capacity for bursts.
- Look for common modes: shared power, racks, software versions, operators, configuration. Independence is what redundancy costs.
- Check the hazard before using memorylessness. Fleets look Poisson; single units, correlated failures and software aging do not.
- Do not let a long job depend on every machine. Checkpoint, or split it into independently restartable tasks.
- Expect operators and software to dominate. Invest in configuration checking, online testing, monitoring and fast rollback.
- Make restart cheap and safe, use pairs whose backups re-execute in their own environment, and quarantine poison inputs.
- Rejuvenate only what wears out.
- Distrust one year of data, especially when outage lengths are heavy-tailed.
Summary
- Vocabulary: a fault (cause) activates an error (wrong state) that may cause a failure (wrong service). A component failure becomes a service failure only if redundancy does not mask it. Availability is doing the right thing on time; reliability is not doing the wrong thing.
- Availability = MTTF/(MTTF + MTTR).
- Gray’s conventional 1985 system came out at 99.56% (≈ 39 h/yr).
- Systems with the same availability can fail 5 or 363 times a year.
- Failing 10× less and repairing 10× faster buy the same availability.
- The exponential model (memoryless; rates add):
- it holds for large fleets (gap CV 1.00 for 1,000 wearing-out machines);
- it fails for single units: Weibull k = 0.5 survivors at 4,000 h expect 3,828 h more, k = 3 survivors 29 h;
- it fails for correlated failures: rack events gave 30 hours with ≥ 10 failures where Poisson predicts 0.0034.
- Composition:
- in a toy service at 99.85%, the non-redundant layers caused 99% of the downtime (config pushes alone 69%); a third database copy saved 3.7 min/yr;
- 100 shards at 99.9% are all up only 90.5% of the time;
- a pool needing 83 servers needs 5 spares for 99.9%.
- Redundancy with repair: MTTF_pair ≈ MTTF²/(2 MTTR).
- Gray’s disc pair: 239 years exactly (field data: 815 years).
- 1-hour repairs give 5,706 years, 30-day repairs 10.
- 1% common-mode failures give 78 years.
- With operators failing every 31 years, a triple is no better than a pair.
- Long jobs: restarting from scratch takes (1/λ + R)(e^{λT} − 1).
- A 10-hour job on 1,000 machines takes 3 years.
- With checkpoints it takes 19.4 h; as independent 1-hour tasks, 11.2 h.
- Empirical studies:
- Gray: administration 42%, software 25%, hardware 18%, environment 14%;
- Oppenheimer et al.: operator (mostly configuration) errors lead in two of three services, are hard to mask and dominate repair time; front ends and networks matter.
- Remedies:
- restart cures Heisenbugs (1 in 132 software faults was a Bohrbug);
- checkpointing pairs tolerate them, lockstep pairs do not;
- quarantining poison inputs took the demo from 99.84% to 99.9975%;
- rejuvenation pays only for processes that age.
Common pitfalls
- Quoting availability without MTTF and MTTR, or without saying available to whom (one request, all shards, weighted by users).
- Adding redundancy to the tier with the most machines while the single points of failure — the core switch, the configuration pipeline — eat the budget.
- Assuming copies fail independently. Same rack, same power, same firmware, same operator.
- Forgetting the repair time. A replica that is never replaced is not redundancy.
- Applying the memoryless property to a component that wears out or suffers infant mortality, or to correlated failures.
- A long job that needs every machine and saves nothing.
- Counting component failures instead of service impact, and so investing in hardware when operators cause the outages.
- Lockstep replication as protection against software bugs.
- Retrying a poison request forever (crash loops).
- Rejuvenating a process whose crashes are memoryless.
- Believing one year’s availability estimate to two decimal places.
Exercises
-
Layers. A service consists of a load balancer pair (each 99.9% available), a front-end tier that needs 3 of 4 servers (each 99%), and a single database (99.95%). (a) Compute the service’s availability and downtime per year. (b) Which single change helps most: a third load balancer, a fifth front-end server, or a standby database (making it 1-of-2)?
Answer
(a) Load balancers: 1 − 0.001² = 0.999999. Front end: P(at least 3 of 4 up) = 0.99⁴ + 4 × 0.99³ × 0.01 = 0.96060 + 0.03881 = 0.999408. Database: 0.9995. Product ≈ 0.999999 × 0.999408 × 0.9995 ≈ 0.998908, about 9.6 hours a year. (b) Unavailabilities: load balancers 10⁻⁶, front end 5.9 × 10⁻⁴, database 5 × 10⁻⁴. A third load balancer saves almost nothing. A fifth front-end server makes it 3-of-5: unavailability ≈ C(5,2) × 0.01³ ≈ 10⁻⁵, saving ~5.8 × 10⁻⁴ (5.1 h/yr). A standby database makes it ≈ 2.5 × 10⁻⁷ if failures are independent and repair works, saving ~5 × 10⁻⁴ (4.4 h/yr). The fifth front-end server wins narrowly, and the two together would bring the service to about 99.999%. The real-world answer also depends on common modes: a standby in the same rack, or fed by the same configuration push, helps less. -
Repair and common mode. Two replicas each have MTTF 2,000 h. (a) Estimate the pair’s MTTF with 2-hour automated failover and re-replication vs 48-hour manual repair. (b) Now 2% of each replica’s failures are common-mode. Recompute both. What do you conclude?
Answer
(a) MTTF²/(2 MTTR): 4 × 10⁶/4 = 10⁶ h (≈ 114 years) with 2-hour repair; 4 × 10⁶/96 ≈ 41,700 h (≈ 4.8 years) with 48-hour repair. (b) The common-mode rate is 0.02/2,000 = 10⁻⁵ per hour, a ceiling of 10⁵ h (11.4 years). Combining rates: 1/(10⁻⁶ + 10⁻⁵) ≈ 91,000 h (10.4 years) with fast repair; 1/(2.4 × 10⁻⁵ + 10⁻⁵) ≈ 29,400 h (3.4 years) with slow repair. Fast repair is worth 24× without common modes but only 3× with them. Once common modes exist, the next investment is independence (separate racks, versions, operators), not faster repair. -
How often does something break? A storage cluster has 6,000 disks with an annual replacement rate of 3% and repairs (re-replication) that take 6 hours. (a) How many disk replacements per day? (b) On average, how many disks are under repair at any moment? (c) Why might the answer to (b) be optimistic?
Answer
(a) 6,000 × 0.03 / 365 ≈ 0.49 per day, about one every two days. (b) By Little's law, the number in repair = arrival rate × time in repair = (180/8,766 per hour) × 6 h ≈ 0.12. (c) Field data show correlated replacements (a failure makes another soon more likely, batches share defects, a rack loses power), so failures come in bursts; and re-replication is slower when many disks fail at once, because they compete for the same bandwidth. Repair capacity must be sized for bursts. -
Burn-in economics. A batch of 1,000 servers contains about 30 weak units whose lifetimes are mostly under 200 hours; the rest fail at random about 3% a year. A field failure in the first month costs a site visit; a burn-in costs factory time. (a) What does a 300-hour burn-in remove? (b) What does it not remove? (c) If the servers fail by wear-out instead (no weak units), is burn-in useful?
Answer
(a) Most of the 30 weak units fail in the factory instead of at customer sites. (b) The random failures of the strong units, about 3% a year, whatever the burn-in. Burn-in only removes the excess above the floor, as in demo 02 Part B. (c) No. Under wear-out, a unit that has run 300 hours is slightly *worse* than a new one, so burn-in uses up useful life and removes nothing. Burn-in pays only when the hazard decreases early in life. -
Independent tasks. A batch job consists of 2,000 independent tasks of 30 minutes each, run on 500 machines (4 tasks per machine, one after another). Machines fail at random with MTTF 500 h; a failed task is re-run elsewhere after 5 minutes. (a) About how many task executions are interrupted? (b) Roughly how long does the job take? (c) What would happen if the same work were one tightly coupled 2-hour computation on all 500 machines?
Answer
(a) Each 30-minute task is interrupted with probability ≈ 0.5/500 = 0.1%, so about 2 of the 2,000 tasks. (b) About 2 hours, plus at most ~5 minutes of rescheduling and up to half an hour of re-execution on the unlucky machine: roughly 2.1–2.5 hours. (c) The set fails at rate 500/500 = 1 per hour, so λT = 2. Restart-from-scratch takes about (1 h + 5 min)(e² − 1) ≈ 6.9 hours on average, with a long tail. Independent tasks make the job's failure rate per *task*, not per *job*. -
Reading a log. In one quarter (2,190 hours), a service had these service failures (detection + repair, share of users affected): 30 min / 100%; 2 h / 20%; 10 min / 100%; 6 h / 5%; 45 min / 50%. (a) Compute MTBF, mean outage, availability counting each outage as total, and user-weighted availability. (b) Which incident would you investigate first, and why?
Answer
(a) Five failures: MTBF ≈ 2,190/5 = 438 h. Total outage 0.5 + 2 + 0.167 + 6 + 0.75 = 9.42 h; mean outage 1.88 h; availability 1 − 9.42/2,190 = 99.57%. User-weighted downtime 0.5 + 0.4 + 0.167 + 0.3 + 0.375 = 1.74 h, so 99.92%. (b) By user-weighted impact, the 30-minute total outage (0.5 h) and the 45-minute half outage (0.375 h) matter most. By hours, the 6-hour incident dominates, but it hit only 5% of users. Ask also *why* each took so long: a 6-hour repair suggests slow diagnosis (often an operator or configuration problem) that better tools or monitoring would shorten. Five events in one quarter is also a small sample (§6.3). -
Which pair? A trading gateway must survive (i) a CPU failure, (ii) a rare race condition in its order-matching code, and (iii) a malformed order that crashes the parser every time. For each of a lockstep pair, a checkpointing pair, and a checkpointing pair with quarantine, say which of (i)–(iii) it survives.
Answer
Lockstep: (i) only; both twins hit the race at the same instruction, and both parse the bad order. Checkpointing pair: (i), and (ii) with high probability, because the backup re-executes in a different timing environment; but (iii) crashes the backup too, and if the order stays in the input queue the pair crash-loops. With quarantine: (i), (ii) and (iii). The malformed order is rejected after it crashed two processes, so the service survives, though that order is never executed. It should be reported to an operator, because a reproducible crash is a bug to fix. -
When to rejuvenate. A process’s crashes are memoryless with mean 20 days; a crash costs 30 minutes, a planned restart 2 minutes. (a) Should it be restarted weekly? (b) The team measures and finds that the crash rate in the second week of uptime is three times that of the first week. What changes?
Answer
(a) No. Under a memoryless model a restarted process is no more reliable than the old one, so weekly restarts only add 2 minutes of planned downtime per week, without preventing any crashes. (b) A rising hazard means the process ages (a leak, fragmentation). Now a planned restart resets it to a low-hazard state. A restart roughly every week or two is likely to pay, since each one costs 2 minutes and the crash risk it removes costs 30. Compute the best interval with the renewal-reward formula of demo 06 Part B, using a fitted Weibull. Better still, find the leak.
Related project and problem set (concepts only)
- Problem Set 3 asks about running long jobs on flaky hardware and about failure behaviour. The concepts are in §3.1 (memoryless lifetimes, rates add), §5 (restarts and the exponential cliff) and Lecture 14 (fail-fast vs Byzantine). The scenarios and numbers here are deliberately different, and the answers are not here.
- Project 4 (two-phase commit) must survive node crashes and lost messages. This lecture explains why such failures are the normal case; Lectures 16–18 build the mechanisms. No project code here.
Further reading
- J. Gray, “Why Do Computers Stop and What Can Be Done About It?”, Tandem TR 85.7, 1985 — short, data-driven, and still the best introduction to software fault tolerance.
- D. Oppenheimer, A. Ganapathi and D. A. Patterson, “Why Do Internet Services Fail, and What Can Be Done About It?”, USITS 2003.
- A. Avižienis, J.-C. Laprie, B. Randell and C. Landwehr, “Basic Concepts and Taxonomy of Dependable and Secure Computing”, IEEE TDSC 1(1), 2004 — the fault/error/failure vocabulary.
- B. Schroeder and G. A. Gibson, “Disk Failures in the Real World: What Does an MTTF of 1,000,000 Hours Mean to You?”, FAST 2007.
- G. Candea and A. Fox, “Crash-Only Software”, HotOS 2003; G. Candea et al., “Microreboot — A Technique for Cheap Recovery”, OSDI 2004.
- Y. Huang, C. Kintala, N. Kolettis and N. D. Fulton, “Software Rejuvenation: Analysis, Module and Applications”, FTCS 1995.
- D. Patterson et al., “Recovery-Oriented Computing (ROC): Motivation, Definition, Techniques, and Case Studies”, UC Berkeley TR UCB//CSD-02-1175, 2002.
- L. A. Barroso, U. Hölzle and P. Ranganathan, The Datacenter as a Computer, 3rd ed., Morgan & Claypool, 2018 — the chapter on failures and repairs at warehouse scale.
Preview of Lecture 14 — Failures II: fail-fast vs Byzantine, and the limits of resilience
This lecture asked how often things fail. Lecture 14 asks how they fail, and what that does to the number of replicas we need:
- the hierarchy of failure models, from crash-stop through omission and timing failures to Byzantine (arbitrary, even malicious) behaviour;
- how checks and checksums make faults fail-fast;
- the Byzantine generals problem: why three generals cannot tolerate one traitor, why 3f + 1 are needed, and how signed messages change the bound;
- timeouts as imperfect failure detectors, and the FLP result that no algorithm can always reach agreement in an asynchronous system with even one crash.
术语表 (Glossary, English → 中文)
| English | 中文 |
|---|---|
| fault / error / failure | 故障(缺陷) / 错误 / 失效 |
| latent fault | 潜伏故障 |
| component failure / service failure | 组件失效 / 服务失效 |
| fault tolerance / masking | 容错 / 屏蔽 |
| fault containment | 故障隔离(遏制) |
| reliability / availability | 可靠性 / 可用性 |
| mean time to failure (MTTF) | 平均无故障时间 |
| mean time to repair (MTTR) | 平均修复时间 |
| mean time between failures (MTBF) | 平均故障间隔时间 |
| nines | 几个九(可用性等级) |
| downtime | 停机时间 |
| error budget | 错误预算 |
| service level objective (SLO) | 服务等级目标 |
| exponential distribution / memoryless | 指数分布 / 无记忆性 |
| hazard rate (failure rate) | 风险率(失效率) |
| mean residual life | 平均剩余寿命 |
| Weibull distribution / shape parameter | 威布尔分布 / 形状参数 |
| infant mortality / wear-out | 早期失效 / 损耗失效 |
| bathtub curve | 浴盆曲线 |
| burn-in | 老化筛选(预烧) |
| Poisson process / superposition | 泊松过程 / 叠加 |
| correlated failures / failure domain | 相关失效 / 故障域 |
| series / parallel system | 串联 / 并联系统 |
| k-of-n system | n 中取 k 系统 |
| redundancy / replica | 冗余 / 副本 |
| window of vulnerability | 脆弱窗口 |
| common-mode failure | 共因失效 |
| Markov chain / absorbing state | 马尔可夫链 / 吸收态 |
| repair crew | 维修队(维修能力) |
| re-replication | 重新复制 |
| N + k provisioning (spares) | N+k 冗余配置(备件) |
| checkpoint / restart | 检查点 / 重启 |
| tightly coupled job | 紧耦合作业 |
| re-execution | 重新执行 |
| operator error / configuration error | 操作员失误 / 配置错误 |
| time to detect / time to repair | 检测时间 / 修复时间 |
| post-mortem | 事后分析(复盘) |
| incident log | 事故日志 |
| bootstrap | 自助法 |
| fail-fast | 快速失败 |
| heartbeat (“I am alive”) | 心跳 |
| process pair / lockstep | 进程对 / 锁步 |
| state checkpointing / persistent process | 状态检查点 / 持久进程 |
| Bohrbug / Heisenbug | 玻尔虫(确定性缺陷) / 海森虫(偶发性缺陷) |
| watchdog | 看门狗 |
| poison request / quarantine (dead-letter queue) | 毒请求 / 隔离(死信队列) |
| crash loop | 崩溃循环 |
| crash-only software / microreboot | 仅崩溃软件 / 微重启 |
| software aging / rejuvenation | 软件老化 / 软件再生(定期重启) |
| recovery-oriented computing | 面向恢复的计算 |
| online testing / fault injection | 在线测试 / 故障注入 |