Expand description
Lease renewal (§12): while this daemon is busy in a long backend call, a
thread renews the leases it holds, so the watchdog does not take over
from a live daemon. It keeps one journal handle and catches up on what
others appended (sync_ledger), rather than opening the journal again
each time: opening reads the checkpoint and the whole log, and after a
compaction the rest of the store, so renewing would cost the journal’s
size every 20 s and be slowest when the journal is fullest.
Functions§
- due
- The leases
meholds on transactions mid-flight (past their last pre-mutation state), each with the epoch and worker its lease has. - renew
- One renewal: catch up, then renew what
meholds mid-flight. An error catching up leaves the handle to be dropped and opened again. - renew_
due - A
Renewfor each lease indue. A record refused (a takeover won the race sinceduewas read) costs only itself; the others are renewed. Returns how many were.
Type Aliases§
- Due
- A lease to renew: the transaction, its epoch and its worker.