State and levels
Replaying the MANIFEST produces the store’s file state. Each edit is applied in order.
Applying an edit
Section titled “Applying an edit”- Remove the listed ids.
- Append the adds.
replay_from = max(old, new).next_file = max(old, new).- Replace the ranges if present.
gc_floor = max(old, new).- Replace the drops wholesale if present.
The first record of every MANIFEST is a full snapshot: adds are all files, plus replay_from, next_file, ranges if non-default, the GC floor if non-zero, and drops if any.
Field meanings
Section titled “Field meanings”| Field | Meaning |
|---|---|
level |
0 is L0: files may overlap, newest id first. 1 and up are sorted and non-overlapping within the level. Values greater than or equal to max_levels clamp to the last level |
size |
file size in bytes (needed for remote files) |
entries, min_ts, max_ts, smallest, largest |
copies of footer and index facts used for planning without opening the file |
location |
0 local (<id>.stc), 1 remote (object plus <id>.stci) |
global_ts |
if not 0, every entry of the file is read with this timestamp (ingested files) |
format |
the per-file stamp: the minimum of the writer’s current format and every source file whose blocks were copied verbatim |
replay_from |
WAL stream offset; records with end <= replay_from are already in data files |
next_file |
lower bound for the next file id (open also uses max id + 1) |