Backend & systems·Consistency and replication
the old leader wakes up from a long pause still believing it holds the lock, and the storage layer rejects its write because its number is stale.
Fencing token
Also calledlease token, epoch number
A monotonically increasing number handed out with a lock or lease, which the resource checks and refuses if it has already seen a higher one. It is what makes distributed locking actually safe, because a process can be paused arbitrarily long by GC or scheduling and wake with an expired lease it does not know is expired. Without fencing, a distributed lock is a strong suggestion.