Skip to content

Each MANIFEST record decrypts to one edit. The first record of the file is a full snapshot; later ones change it. Integers marked varint use the varint encoding.

varint n_adds
n_adds x add:
level u8
varint id, varint size, varint entries, varint min_ts, varint max_ts
key smallest, key largest key = varint len ‖ user bytes ‖ varint ts
varint n_removes ‖ n_removes x varint id
opt replay_from opt = 0x00 | 0x01 ‖ varint
opt next_file
[ varint n (must == n_adds) ‖ n x location u8 ] 0 = local, 1 = remote; omitted only by very old writers
tagged section* tag u8 ‖ body, any order, each at most once
Field Encoding Meaning
n_adds varint number of added files
add see File entry (add) one per added file
n_removes, ids varint, varint each ids of files to remove
replay_from 0x00, or 0x01 followed by a varint WAL stream offset, optional
next_file same optional encoding lower bound for the next file id, optional
locations varint n equal to n_adds, then n bytes 0 local, 1 remote; omitted only by very old writers
tagged sections tag byte then body see Tagged sections

Tagged sections may come in any order. A repeat of tag 1, 4, 5 or 7 is Corrupt("manifest trailing bytes"); a repeat of tag 2 is not detected and overwrites the first. Writers emit them in the order 1, 2, 4, 5, 7. Any other tag, including 3 and 6, is Corrupt("manifest trailing bytes").

See State and levels.