Commit record
A commit record is the payload of a framed record written by the transaction layer (strata-txn).
Layout
Section titled “Layout”| Field | Encoding | Meaning |
|---|---|---|
ts |
u64 LE, 8 bytes | commit timestamp in microseconds since the Unix epoch, never 0 |
n |
u32 LE, 4 bytes | number of operations |
| operations | n times |
kind u8 (1 = Put, 2 = Delete) ‖ klen u32 ‖ key ‖ vlen u32 ‖ value (empty for Delete) |
resolves |
u64 LE, 0 or 8 bytes | optional: id of an intent this commit resolves; present if and only if exactly 8 bytes remain |
Reading the optional field
Section titled “Reading the optional field”After the n operations, a reader checks how many bytes remain in the payload. Exactly 8 means resolves is present. Zero means it is absent. The rule is positional, see Auxiliary record.
Commit ts is never 0, which is what distinguishes a commit from an auxiliary record.
Replay
Section titled “Replay”Commit records with end > replay_from are applied to the memtable, see Recovery. Keys and values follow the encodings in Key encodings.