Part 6 of 9
Tolerating hardware faults with redundancy
- The first answer is spare parts: RAID (data spread over several disks in one machine), two power supplies, CPUs that can be swapped while running, and datacenter batteries and diesel generators. This can keep one machine running for years.
- Redundancy works best when faults are independent: one fault does not change the odds of another. In real life faults are often correlated, so whole racks or datacenters still go dark too often.
- Hardware redundancy raises how long one machine stays up. A distributed system can go further and survive losing a whole datacenter.
- So cloud systems care less about one perfect machine and more about high availability: software tolerates faulty nodes.
- Availability zones are cloud labels for resources that sit together physically. Things in the same zone are more likely to fail together, so spread across zones.
- The techniques in this course let a machine elsewhere take over when a machine, rack, or zone is lost.
- A multi-node system also allows rolling upgrades: patch and restart one node at a time with no downtime. A single server would need planned downtime for each reboot.
Software faults
- Hardware faults are mostly independent. Software faults are strongly correlated, because many nodes run the same code with the same bugs. They are harder to predict and cause more failures.
- Examples:
- A bug that hits all nodes at once under one condition, like the June 2012 leap second that froze many Java programs through a Linux kernel bug. - SSD firmware that made one family of drives all die after exactly 32,768 hours (under four years), losing their data. - A runaway process eating a shared resource such as CPU, memory, disk, network, or threads; for example, one huge request gets killed by the operating system, or a buggy client library floods a service with requests. - A service you depend on slows down, stops answering, or sends back corrupted data. - Surprises that only appear when systems interact, never when each is tested alone. - Cascading failures: a problem in one part overloads the next, which knocks over another.
- These bugs hide for a long time until unusual conditions break an assumption that was usually true.
- There is no quick fix. Many small things help:
- think hard about assumptions and how parts interact, - test thoroughly, - isolate processes from each other, - let crashed processes restart, - avoid feedback loops such as retry storms, - measure, monitor, and study how the system behaves in production.