wal-record-length-prefixed

Status: IN

Every WAL record is prefixed with a 4-byte little-endian length covering all subsequent fields (CRC through value), enabling the reader to know exactly how many bytes to consume

Source: entries/2026/05/28/topic-lsm-crash-recovery-wal-format.md

Example

record_length = 4 + 8 + 1 + 4 + len(key) + 4 + len(value)
header = struct.pack("<IIQBi", record_length, crc, seq_num, op_type_byte, len(key))
return header + key + struct.pack("<i", len(value)) + value

JSON