Skip to content

Manifest format ​

The byte layout of a manifest, m/<generation>.mft. What a manifest means is in design.md.

u32magic"OLGN" (0x4f4c474e)
u32version5
u64generation
u64through
marks block
u32run count
run 0
…
u32crc32of every byte before it
per run
u16path length
pathUTF-8, relative to the database root
u32bytessize of the run file
u8has range
u32lengthif has range
smallest key
u32length
largest key
u64marksThrough
marks block
u32count0 is valid: no marks
mark 0
…
per mark
u32start length
startthe first key of the range
u8has end
u32lengthexclusive if has end
end key
u64through
u64at

bytes and the key range let the compaction planner size and route levels without opening a file. The level of a run is in its path.

Runs are listed L0 first, newest first. Each deeper level follows, with its runs sorted by smallest key. Reads use that order directly.

The marks block holds the marks, in no particular order, and marksThrough is a run's claim against them. design.md gives the meaning of both.

A reader rejects any other version as corrupt, and a marks block that breaks its rules, a mark with through 0, an end not above its start, at at or below its through or past the manifest's through, or a run whose marksThrough is past it.