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
Directoryimplementation.
§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:
crc32fastover 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.
- Record
LogReader - Sequential record log reader.
- Record
LogWriter - Append-only record log writer.
Enums§
- Record
LogRead Mode - Read mode for record logs.