Fencing Token
A monotonically increasing number handed out with a lock, so a stale lock-holder can be rejected.
A fencing token is a strictly increasing number issued each time a lock or lease is granted. Clients attach it to their writes, and the resource rejects any write carrying a token older than the highest it has seen — so a client that paused (GC, network stall) and lost its lock cannot corrupt data when it wakes up.
Worked example: client A gets the lock with token 33 and stalls; the lock expires and client B gets token 34 and writes; when A wakes and tries to write with token 33, the storage rejects it because it already saw 34. Gotcha: a lock service alone is not enough — without fencing, a process that stalls past its lease can still issue a “valid” write and clobber the new holder’s data; the resource itself must enforce the token ordering, not just the lock service.