Fencing token
A fencing token identifies an ownership generation that a receiving service checks to reject operations from an obsolete owner.
In one lock-service design, a holder can request a sequencer, an opaque byte string recording the lock name, the acquisition mode (exclusive or shared) and the lock generation number. A receiving server checks it against the lock service or against the most recent sequencer it has observed, and rejects stale requests. Merely issuing or attaching a token does not enforce exclusion. The 2006 design caps lock-delay at 1 minute for failed or unreachable holders; normal release makes the lock immediately available. This is not a current default or an I/O completion guarantee. [1]
In a worked example, a client holding token 33 pauses while its lease expires, a second client obtains token 34 and writes, and storage then rejects the delayed write carrying 33 because it has already processed a higher number. Stop-the-world garbage collection pauses of several minutes and a recorded network packet delay of 90 seconds show that such pauses outlast realistic leases. [3]
Relations
- related
- Minuet (SAN coordination), I/O fencing, SCSI persistent reservations, Shared-disk file system, Lock-delay
Advantages
- Because the resource itself enforces ordering, safety does not depend on bounded process pauses, bounded network delay or accurate clocks at the lock holder. [3]
Limitations
- The token source must be strictly monotonic across its own failures: a unique random value lacks ordering, a single-node counter can be lost and independent counters on several nodes drift apart, which points toward consensus. [3]
- Protection covers only resources that check tokens, so services unable to validate sequencers remain exposed to stale operations. [1]
- Rejecting obsolete requests does not by itself provide multi-resource transaction atomicity. Minuet keeps per-resource session state at the target and adds a separate transaction and log-recovery protocol. [4]
Citations
- Mike Burrows. The Chubby lock service for loosely-coupled distributed systems. OSDI 2006, sections 2.1 and 2.4.
- Martin Kleppmann. How to do distributed locking. Essay, 8 February 2016, sections on fencing and synchrony assumptions.
- Ermolinskiy, Moon, Chun and Shenker. Minuet: Rethinking Concurrency Control in Storage Area Networks. FAST 2009, sections 3.2 and 3.4.2.
Further reading
Sources & caveats
- lock-service-osdi06 read 2026-10-23, section 2.4, for sequencer contents, server-side checking and the lock-delay bound.
- fencing-essay read 2026-10-23, sections on fencing and timing assumptions, for the 33 and 34 token example, pause durations and token-source requirements.
- A companion analysis on stale storage writes is listed but not used in prose.
- Section 2.4 rechecked 2026-10-23: the delay follows loss of a holder, not ordinary release; the historical cap does not bound delayed I/O.