[{"data":1,"prerenderedAt":79},["ShallowReactive",2],{"term-f\u002Ffencing-token":3,"related-f\u002Ffencing-token":60},{"id":4,"title":5,"acronym":6,"body":7,"category":40,"description":41,"difficulty":42,"extension":43,"letter":44,"meta":45,"navigation":46,"path":47,"related":48,"seo":54,"sitemap":55,"stem":58,"subcategory":6,"__hash__":59},"terms\u002Fterms\u002Ff\u002Ffencing-token.md","Fencing Token",null,{"type":8,"value":9,"toc":33},"minimark",[10,15,19,23,26,30],[11,12,14],"h2",{"id":13},"eli5-the-vibe-check","ELI5 - The Vibe Check",[16,17,18],"p",{},"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.",[11,20,22],{"id":21},"real-talk","Real Talk",[16,24,25],{},"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.",[11,27,29],{"id":28},"when-youll-hear-this","When You'll Hear This",[16,31,32],{},"\"Without fencing tokens, the zombie leader from before the GC pause could still corrupt data.\" \u002F \"Every write includes the lease's fencing token, storage rejects anything with a stale one.\"",{"title":34,"searchDepth":35,"depth":35,"links":36},"",2,[37,38,39],{"id":13,"depth":35,"text":14},{"id":21,"depth":35,"text":22},{"id":28,"depth":35,"text":29},"architecture","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...","advanced","md","f",{},true,"\u002Fterms\u002Ff\u002Ffencing-token",[49,50,51,52,53],"Distributed Lease","Split Brain","Clock Skew","Consensus Algorithm","Idempotency",{"title":5,"description":41},{"changefreq":56,"priority":57},"weekly",0.7,"terms\u002Ff\u002Ffencing-token","OUufIkXVdbdL0mS-V_WiOicbm-PgmTNsxnUybCmF_Jk",[61,65,69,72,76],{"title":51,"path":62,"acronym":6,"category":40,"difficulty":63,"description":64},"\u002Fterms\u002Fc\u002Fclock-skew","intermediate","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...",{"title":52,"path":66,"acronym":6,"category":67,"difficulty":42,"description":68},"\u002Fterms\u002Fc\u002Fconsensus-algorithm","database","A consensus algorithm is how a group of servers democratically agree on something even when some of them are flaky or unreachable.",{"title":49,"path":70,"acronym":6,"category":40,"difficulty":42,"description":71},"\u002Fterms\u002Fd\u002Fdistributed-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...",{"title":53,"path":73,"acronym":6,"category":74,"difficulty":63,"description":75},"\u002Fterms\u002Fi\u002Fidempotency","backend","Idempotency means doing the same thing twice gives you the same result as doing it once.",{"title":50,"path":77,"acronym":6,"category":40,"difficulty":42,"description":78},"\u002Fterms\u002Fs\u002Fsplit-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...",1792528084809]