Skip to main content

Module renew

Module renew 

Source
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 me holds 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 me holds mid-flight. An error catching up leaves the handle to be dropped and opened again.
renew_due
A Renew for each lease in due. A record refused (a takeover won the race since due was 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.