Curriculum · Module 05, Consensus and Coordination
Locks, leases and fencing
A distributed lock expires, its holder does not notice, and storage pays. What a fencing token fixes and what it cannot.
What each topic covers
- A client holds a valid lock, stalls, loses it without noticing, and writes anyway. Every part did its job and the data is still wrong.
- How a lease is granted and expires, what a stalled holder sees, and why a growing number checked at storage closes the gap.
- Run the same clients and the same stalls against storage that trusts the lock and storage that checks a token.
- The measured corruption, what a longer lease and a careful clock check buy, and what fencing does not fix.
- Why a lock that is safe only if clocks, networks and pauses behave is a different thing from one that is safe regardless, using a five-node majority lock as the example.
- How Chubby keeps one session lease alive with KeepAlives, what a client does when the lease lapses during a failover, and how its sequencer and lock-delay protect servers.
- Three quick checks on stale writes after a lease check, where a token is verified and when a lock needs fencing, plus the papers behind the lesson.
Topics
Practise this lesson
14 interview questions on locks, leases and fencing, with worked answers and sources.
Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms