Expand description
Write-ahead log for LoraDB.
lora-wal is the additive durability layer that sits between
lora_store::MutationEvent producers (the in-memory engine) and a
durable byte stream on disk. It is deliberately separate from
lora-store:
lora-storestays storage-only — backends do not learn about logs, segments, or fsync. The mutation surface they already expose (MutationEvent+MutationRecorder) is the only seam.lora-walowns segment files, framing, replay, and truncation. Consumers depending on the no-WAL story (wasm, embedded read-only) can avoid this crate entirely.lora-databaseglues the two together: it installs aWalRecorderonto the store and brackets each query witharm/commit/abortmarkers so replay sees query-atomic units even though the recorder fires per primitive mutation.
See docs/decisions/0004-wal.md for the full design and
docs/operations/wal.md for operator-facing semantics.
Structs§
- Lsn
- Monotonic log sequence number.
- Replay
Outcome - Outcome of a full replay walk.
- Segment
Id - Monotonic identifier for a WAL segment file.
- Torn
Tail Info - Wal
- Live, append-side WAL handle.
- WalRecorder
- Adapter that lets a
Walact as aMutationRecorderonlora_store::InMemoryGraph::set_mutation_recorder.
Enums§
- Sync
Mode - Durability mode for committed transactions.
- WalConfig
- Configuration for opening a
Wal. - WalError
- Failure modes for WAL operations.
- Wrote
Commit - Whether
WalRecorder::commitactually wrote aTxCommitto the log. Read-only queries — those that never triggerMutationRecorder::record— returnWroteCommit::Noso the host can skip the surroundingflush()and avoid a per-queryfsyncjust to record an empty transaction.
Traits§
- WalMirror
- Optional side-effect after the WAL has successfully flushed.
Functions§
- replay_
dir - Convenience: replay every
*.walsegment indirafter sorting by the numeric prefix encoded in the file name.