Write-ahead log
The write-ahead log records every commit before it reaches a data file. It lives in wal/ under the store root. It is a series of segments, each a run of 4096-byte blocks sealed whole. The payloads of consecutive blocks form one logical byte stream, and records are framed inside that stream.
- Segments: file names, preallocation and WAL format numbers.
- WAL block: header, payload and seal trailer, and when a block is valid.
- Record framing: length, CRC32C, LSN, and records that span blocks.
- Commit record and Auxiliary record: the two record payloads written by the transaction layer.
- Durability modes: when a commit is acknowledged. The bytes on disk are identical in every mode.
- Recovery: how replay accepts blocks and records.
Integrity
Section titled “Integrity”Each block is sealed with AES-256-GCM, see Encryption at rest. Inside the sealed payload every record carries a CRC32C. Records are replayed from the replay_from offset kept in the MANIFEST. WAL format is 1 in every release and pre-release stamp.