Skip to main content

Module tracker

Module tracker 

Source
Expand description

Recording the log entries a processor ingests.

LogTracker is the hook the processor calls for every ingested entry, enqueued into the same batch that applies the entry. Implementations decide what to record. LogIndexTracker is the built-in one — an op-log table keyed by (peer_id, entry_idx) that future readers can dedup, revision history, and attribution from without replaying the reducer.

Readers derive from the table without replaying the reducer — all_cursors for the version vector, HistoryTracker::read_entries to reconstruct entries. The expunged-marker rows track_expunged writes (tag = TAG_EXPUNGED, no attribution, no timestamp) occupy a stream index but are not real entries, so a reader must not count or attribute them.

Structs§

LogIndexTracker
The default LogTracker: writes each entry into a single <prefix>__oplog table keyed by (peer_id, entry_idx), storing the HLC timestamp and the op’s decoded index key/value.

Enums§

LogTrackerError
Failure from LogTracker::track_one. Splitting the op into its index triple is a CodecError; binding a value that won’t fit the backend’s signed-integer column (a u64 past i64::MAX, via DbValue::from_u64) is a DbError. Both are surfaced so the tracker can use the same checked conversion the rest of the crate relies on instead of a lossy as cast.

Traits§

HistoryTracker
A LogTracker that also reconstructs stored entries — the op-log case, which keeps full history and so can back a replication LogSource.
LogTracker
Records each log entry as the processor ingests it.