Expand description
Segmented WAL: manages a directory of segment files with automatic rollover and truncation.
This is the primary WAL interface for production use. It wraps WalWriter
and WalReader to provide:
- Automatic segment rollover when the active segment exceeds a target size.
- Truncation of old segments after checkpoint confirmation.
- Transparent multi-segment replay for crash recovery.
- Legacy single-file WAL migration.
§Thread safety
SegmentedWal is NOT Send + Sync by itself. The WalManager in the main
crate wraps it in a Mutex for thread-safe access from the Control Plane.
Structs§
- Segmented
Wal - A segmented write-ahead log.
- Segmented
WalConfig - Configuration for the segmented WAL.
Functions§
- replay_
all_ segments - Replay all records from all segments in a WAL directory, in LSN order.
- replay_
from_ limit_ dir - Paginated replay from a WAL directory: reads at most
max_recordsfromfrom_lsn.