Choosing a footer revision
A footer holds one of five revisions in its version field. A reader checks the flags against the revision, and a writer picks the revision from what it wrote.
Legal flags
Section titled “Legal flags”parse_footer (sst.rs:1501) accepts only these combinations. STATS is optional in revisions 1 to 4 and required in revision 5.
| Revision | Name | Legal flags | Writer chooses it when |
|---|---|---|---|
| 1 | plain | no SKIP, no RANGES, no COUNTS | none of the below |
| 2 | bloom skip | SKIP set, no RANGES, no COUNTS | skip tags present |
| 3 | codec | no RANGES, no COUNTS (SKIP free) | an LZ4 frame was written |
| 4 | ranged bloom | SKIP and RANGES set, no COUNTS | at least one key was left out by a bloom-off prefix (SPEC V729) |
| 5 | block counts | STATS and COUNTS set; RANGES implies SKIP | the file has a stats frame (default for every new file) |
Writer priority
Section titled “Writer priority”When writing, the first rule that matches wins:
- stats frame present: revision 5
- else ranged: revision 4
- else LZ4 frame: revision 3
- else skip: revision 2
- else revision 1
Reader rules
Section titled “Reader rules”versiongreater than 5 isNewerFormat("sst footer").- A magic mismatch or version 0 is
Corrupt. - A flag combination not legal for the revision is
Corrupt("sst footer flags").
Revisions 4 and 5
Section titled “Revisions 4 and 5”These were added without a store-format bump. A build that does not know them reads the footer, sees the revision, and fails with NewerFormat("sst footer"). See Compatibility rules.
Related
Section titled “Related”- Footer and Footer flags
- Revision 1, 2, 3, 4, 5
- Version matrix