
A lease is a right with an expiry time. A system allows an actor to hold a resource or role temporarily, but that authority remains valid only if it is renewed before the deadline.
Suppose a distributed system chooses one server to perform a task. It cannot assume that server will remain reachable forever. The server renews its lease periodically; if communication is lost, the coordinator may assign the task elsewhere after expiry. Expiry does not prove that the original server has failed. It means only that the server no longer has authority the system can collectively recognise.
A lease differs from permanent permission and from a heartbeat. A heartbeat reports that something was alive recently; a lease specifies the time after which old authority must cease. Nor can a lease alone remove conflicts caused by clock error or delay. Practical systems may still require versions, fencing tokens or other constraints.
Its value is that it turns uncertain disconnection into bounded waiting. The trade-off lies in the duration: a lease that is too short may expire during a temporary delay, while one that is too long leaves resources tied to an unreachable holder.
https://etcd.io/docs/v3.4/learning/api/
Discover more from Geoffrey Chen
Subscribe to get the latest posts sent to your email.