Skip to main content

Module record

Module record 

Source
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§

RecordHeader
WAL record header (fixed 30 bytes).
WalRecord
A complete WAL record: header + payload.

Enums§

RecordType
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.