Skip to main content

Module segmented

Module segmented 

Source
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§

SegmentedWal
A segmented write-ahead log.
SegmentedWalConfig
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_records from from_lsn.