Before you start. This series builds a small scheduler: a program that runs jobs at set times across many machines instead of one, the way a single computer’s cron already does for one. Two things about it are already true. One machine at a time is elected leader, using a lease, a lock with a clock on it, so the right to give orders runs out on its own if nobody renews it. And a queue sits between the leader and the workers, and if a worker doesn’t answer back in time, the queue assumes the worst and hands the same job to someone else. Both are sensible, and both, pushed to their honest end, leave a crack open. This lesson closes it.
Lesson 67 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
2016: a blog post that ends a library’s honeymoon
Two ways to be wrong, and they are not the same bug
Idempotency: a name the job can’t fake
Fencing: a number that only climbs
Both at once: what happens when a zombie writes
The run-id, in code
The fencing token, in code
The zombie story, run three times
The honest boundary
What this closes
Terms it explains: The repeat, idempotency, The stale write, fencing, accepted, rejected, Delete the fence check, Delete the run-id check, Change `<` to `<=`, Against a real store, Stripe, Idempotent requests, Temporal, Activities.