Expand description
WAL record format.
On-disk layout (all fields little-endian):
┌──────────┬─────────────────┬────────────┬─────┬───────────┬───────────┬─────────────┬─────────┐
│ magic │ format_version │ record_type│ lsn │ tenant_id │ vshard_id │ payload_len │ crc32c │
│ 4 bytes │ 2 bytes │ 2 bytes │ 8B │ 4 bytes │ 2 bytes │ 4 bytes │ 4 bytes │
└──────────┴─────────────────┴────────────┴─────┴───────────┴───────────┴─────────────┴─────────┘
Total header: 30 bytes
Followed by: [payload_len bytes of payload]Structs§
- Record
Header - WAL record header (fixed 30 bytes).
- WalRecord
- A complete WAL record: header + payload.
Enums§
- Record
Type - Record type discriminants.
Constants§
- ENCRYPTED_
FLAG - Bit 14 in record_type signals that the payload is AES-256-GCM encrypted. This is separate from bit 15 (required flag).
- HEADER_
SIZE - Size of the record header in bytes.
- MAX_
WAL_ PAYLOAD_ SIZE - Maximum WAL record payload size (64 MiB). Distinct from cluster RPC’s limit.
- WAL_
FORMAT_ VERSION - Current WAL format version.
- WAL_
MAGIC - Magic number identifying a NodeDB WAL record.