Before you start. This series builds a small copy of a job scheduler: a program whose whole purpose is to fire other programs at the right moment, the way a phone alarm goes off at 7am with nobody watching the clock by hand. So far, that scheduler runs on one machine, a single computer, and it can already hold thousands of pending jobs while always knowing which one fires next without checking every one of them. This lesson is about what happens the moment you stop trusting that one machine to stay up, and run three of it instead.
Lesson 65 of 117 in From Scratch
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.
Or start free: a free account opens lessons 2 and 3 of every track.
In this lesson
Three schedulers, and the job that fired three times
1989: a parliament that could never all be in the room
The stick you must keep touching
Asleep at the podium
The room stops listening
One atomic compare-and-set
Renewal, and the TTL trade
Failover, on a logical clock
Split-brain, played out
The fix: fencing
Three rules about the token
What fencing does not give you
Terms it explains: Leader election, lease, split-brain, token, Fencing, single atomic operation, etcd, ZooKeeper, Redis, A Postgres row, the zombie's, not, new lease, check the token, sharding the leadership, Delete the fencing check.