pub struct AckTable { /* private fields */ }Expand description
The fold-frontier / ack bookkeeping B3’s relay ack(frontier) reports
against: per-device max folded HLC, monotone-only advance, persisted
alongside the checkpoint (temp + atomic rename, like everything durable
here). This is the proposal’s acked[device] table, device-local.
MUST, binding on B3: an ack asserts durably-folded state. A device
may report ack(frontier) only after the ops at/below that frontier are
durably persisted on it (journal-durable, fold applied) — an ack sent
from memory ahead of the fsync lets compaction drop ops the acking
device then loses in a crash, which is exactly the data loss the stable
frontier exists to prevent. The mirror of B1’s
journal-durable-before-transmit rule.
Implementations§
Source§impl AckTable
impl AckTable
pub fn new() -> Self
Sourcepub fn ack(&mut self, device_id: impl Into<String>, frontier: Hlc) -> bool
pub fn ack(&mut self, device_id: impl Into<String>, frontier: Hlc) -> bool
Advance a device’s acked frontier. Monotone-only: an ack at or below
the current frontier is ignored (returns false) — a delayed or
replayed ack can never move GC eligibility backwards.
pub fn get(&self, device_id: &str) -> Option<&Hlc>
pub fn devices(&self) -> impl Iterator<Item = &str>
Sourcepub fn stable_frontier(&self) -> Option<&Hlc>
pub fn stable_frontier(&self) -> Option<&Hlc>
The stable frontier — min(acked[d]) over every known device
(proposal §“Snapshots”). Ops at or below it are folded by everyone
and are the only truncation candidates. None when no device has
acked (nothing is ever droppable then).