Before a node runs, exactly one holder takes a lease on it. The lease says who holds the node, where and until when.
Architecture contract
LeaseV1 records lease_id, holder, host, process_or_session, scope, acquired_at, heartbeat_at, expires_after, reclaim_policy and state_version.
- One active lease per node scope.
- A lease is kept alive by heartbeats and expires if they stop.
- An expired lease can be reclaimed by the system, and the node rescheduled.
state_version it was granted at, and every durable write is compare-and-swap on that version. A stale holder’s write fails with STATE_CONFLICT instead of overwriting newer work. See State.
Why: without leases, two executors can run the same node. Without fencing, a slow executor that lost its lease can still corrupt the result of the one that replaced it.