Skip to main content

Module meta

Module meta 

Source
Expand description

Page 0: the superblock. Roots of every tree, and the format version.

Structs§

Meta

Constants§

FORMAT_VERSION
Version a newly created store is stamped with. The compact-cells cargo feature still decides only this default; opening never restamps it.
MAX_TREES
META_PAGE
META_PAGE_B
2f: the second commit slot. Generation g lives in page g % 2, so writing generation g+1 only ever overwrites the slot of g-1 – the newest published root is never touched by the write that supersedes it, and a torn slot write fails its page checksum and loses to the other slot. (LMDB’s dual meta page; its pick is by txnid, ours by generation, and unlike LMDB every slot is protected by the ordinary page checksum.)
SUPPORTED_FORMAT_VERSION
Highest logical superblock version this engine reads. Versions 1 (plain cells) and 2 (compact cells) are both supported in every build. The page header’s own version (byte 4) guards the physical page layout; THIS guards the meaning of what the pages contain — key encodings, payload format, keyspace tags. A database stamped with a newer value is refused on open, never guessed at.