Fencing Token
ELI5 - The Vibe Check
Say a node holds a lease, but then it freezes for a while, its lease quietly expires, and a new leader takes over, and THEN the frozen node wakes back up, oblivious, and tries to keep writing as if it's still in charge. A fencing token stops this: it's a strictly increasing number handed out with each lease, and the storage system refuses any write carrying an older number than the last one it saw, even from a node that genuinely thinks it's still the boss.
Real Talk
A fencing token is a monotonically increasing number issued each time a lease or lock is granted, which downstream storage systems check and reject if a write arrives with a token older than the last one accepted. It solves the problem that a lease alone cannot guarantee mutual exclusion under pauses or clock skew, since a client can incorrectly believe it still holds a lease after it has actually expired, the fencing token check at the storage layer is what actually enforces correctness, not the lease timer itself.
When You'll Hear This
"Without fencing tokens, the zombie leader from before the GC pause could still corrupt data." / "Every write includes the lease's fencing token, storage rejects anything with a stale one."
Related Terms
Clock Skew
Every server has its own clock, and those clocks drift apart from each other over time, sometimes by milliseconds, sometimes by embarrassingly more if NTP...
Consensus Algorithm
A consensus algorithm is how a group of servers democratically agree on something even when some of them are flaky or unreachable.
Distributed Lease
A distributed lease is a time-limited 'I've got this' claim that one node takes out on a resource or a role, like being the leader, so everyone else knows...
Idempotency
Idempotency means doing the same thing twice gives you the same result as doing it once.
Split Brain
Split brain is when a network hiccup cuts a cluster of servers in half, and both halves, unable to talk to each other, each decide they're the boss and kee...