Expand description
CAS-backed leader lease with TTL and a monotonic fencing token.
One object per sequence at control/leader-lease/v{seq:016}.json,
written with PutMode::Create so the CAS works on every backend
(LocalFileSystem included). The lease prevents split-brain: a
stale leader whose lease has expired loses the CAS to whoever
acquires next, and the fencing token advances only on an owner
change so followers can reject writes carrying a stale token.
Structs§
- Leader
Lease - A durable leader lease record.
- Leader
Lease Config - Tunables for the lease renewal loop.
- Leader
Lease Manager - Periodically renews the leader lease and publishes the latest record on a watch channel so other tasks can gate on the fencing token.
- Leader
Lease Store - I/O wrapper for
LeaderLeaseon an object store.
Enums§
- Lease
Error - Errors loading or saving a
LeaderLease. - Lease
Outcome - Result of a
LeaderLeaseStore::try_acquireattempt.
Functions§
- lease_
grants_ leadership - True iff
leaseis held bymeand not expired atnow_ms.