Skip to content

5.3. Distributed Locking

A distributed lock promises mutual exclusion across machines, but the promise is fragile: the moment a lock holder pauses — for GC, for a network blip — its lease can expire and a second holder can acquire the same lock, with both believing they hold it. This chapter covers lease-based locking, the fencing tokens that make locks safe for correctness (not just efficiency), and the Redlock debate that crystallizes exactly when a distributed lock can and cannot be trusted.