Skip to main content

Module recordlog

Module recordlog 

Source
Expand description

Append-only record log (generic WAL primitive).

This is the generic record log primitive intended for reuse by multiple segment/index implementations.

Vocabulary note:

  • This module provides integrity (CRC + framing) and crash-recovery posture (strict vs best-effort tail).
  • It does not, by itself, guarantee stable-storage durability; that depends on the underlying Directory implementation.

§Public invariants (must not change without a format bump)

  • File header: [RECORDLOG_MAGIC][FORMAT_VERSION] at byte 0.
  • Record framing (little-endian): len:u32 | crc32:u32 | payload bytes...
  • Checksum: crc32fast over the payload bytes.
  • Limits: payload length is capped at MAX_RECORD_BYTES.

§Recovery posture

This module supports both strict replay and best-effort replay. Best-effort replay is the common WAL posture used by systems like SQLite: scan forward validating checksums and stop at the first truncated tail record.

Structs§

Record
A decoded record.
RecordLogReader
Sequential record log reader.
RecordLogWriter
Append-only record log writer.

Enums§

RecordLogReadMode
Read mode for record logs.