PLAIN/TEXT — ISSUE 311/456 COMPUTER SCIENCE · FOUNDATION / TIME-LIMITED AUTHORITY · ~4 MIN READING DATE: 2027-08-08 ARCHIVE: https://plaintext.click/newsletter/ SUBJECT: Why an expired permission can still cause damage Why an expired permission can still cause damage ================================================ / START HERE A computer program can stop responding while still being able to resume later. A lease is a time-limited permission that another service grants for using a shared resource. Letting that permission expire allows a replacement program to take over, but does not physically stop the old program from sending a delayed command. / WHY NOW Imagine two computers updating one shared document. The first pauses, loses its permission and wakes after the second has already saved new work. Without another check, its old write can overwrite the replacement’s result. / THE IDEA Expiry solves a recovery problem: a crashed owner cannot hold a resource forever. It does not prove that every command from the previous owner has disappeared. A command may wait in a network queue or inside a paused program after the permission was last checked. A fencing token is an increasing number attached to each new grant of authority. The resource receiving writes remembers the greatest accepted number and rejects commands from older grants. The check happens where the effect is applied, not solely in the worker’s belief about whether it still owns the lease. / THE FORMAL IDEA accept write only when token ≥ highest_seen - token is the authority number carried with a write; highest_seen is the largest authority number accepted by that resource. ≥ means at least as large. - The numbers must rise across ownership grants and be bound to legitimate grants, not freely chosen by writers. The resource must check and update its remembered value atomically, as one indivisible action. / RUN THE TINY EXAMPLE Change one thing. Predict what happens. Worker A receives token 41, then pauses. Its lease expires. Worker B receives 42 and writes; the resource remembers highest_seen = 42. A resumes and sends 41. Since 41 < 42, the write is rejected. Change A’s arrival time: if 41 arrives before any 42, this simple test can still accept it. The final change exposes the exact guarantee: older authority cannot write after newer authority has been observed. A fencing number by itself does not tell the resource what time a lease expired. / SO WHAT? This is useful whenever recovery can leave a slow former owner alive. Checking the lease and then writing leaves a pause-sized gap between those actions. Moving authority validation into the destination closes the stale-after-newer path, provided every writing route participates. A strict policy rejecting all work after expiry needs an additional correctly enforced validity check, not a stronger-sounding description of the same counter. / ONE CAVEAT Fencing requires cooperation from the resource and durable authority tracking. A service that accepts unlabelled writes bypasses the protection. Repeated commands from the current owner may still need separate duplicate-effect handling; ownership numbers are not unique operation identifiers. / KEEP THIS A timeout allows replacement; a destination-side authority check stops older owners overwriting work after newer authority has arrived. / SOURCE TRAIL [1] etcd — Executable expired-lease and fencing example https://github.com/etcd-io/etcd/blob/main/contrib/lock/README.md [2] Google — Chubby sequencers and delayed requests, section 2.4 https://storage.googleapis.com/gweb-research2023-media/pubtools/4444.pdf NEXT: Why two equally sunny planets can differ in warmth --- HARD IDEAS. PLAIN TEXT. You are receiving this because you asked for one clear computer-science or physics idea each day. Unsubscribe: https://plaintext.click/unsubscribe View in browser: https://plaintext.click/newsletter/2027/08/2027-08-08-lease-expiry-fencing.html From: Plain/Text / Brickston Consulting · 30 N Gould St Ste N, Sheridan, WY 82801 US · knowledge@plaintext.click