Expand description
Tailing wal.bin: the next byte range to ship, in whole frames.
A WAL frame is [len: u32 LE][crc32: u32 LE][payload: len bytes]
(core_storage::wal::encode_record). A segment always ends on a frame
boundary, so concatenating a generation’s segments in offset order is a
valid WAL.
Structs§
- Frame
Counter - Counts frames in a WAL read in arbitrary chunks, by their headers.
Constants§
- FRAME_
HEADER_ LEN - Frame header:
lenthencrc32, both u32 little-endian. - MAX_
SEGMENT_ BYTES - Most bytes one call reads, unless a single frame is larger. A WAL that grew by more than this since the last tick ships over several segments.
Functions§
- complete_
frames - The prefix of
bytesmade of whole, checksum-valid frames: its length and how many frames it holds. - read_
new_ segment - The next segment of
wal_pathto ship: bytes fromfrom_byteup to at mostdurable_len, cut back to the last complete frame.