pub enum FormatVersion {
V1 = 1,
V2 = 2,
V3 = 3,
V4 = 4,
V5 = 5,
}Expand description
Block / SST disk format version.
This enum tracks the on-disk layout of Blocks and SST files: block
header layout, filter wire format, range-tombstone encoding, ECC
trailer geometry. It is the version persisted in the manifest’s
format_version section and gated at Tree::open.
§Relationship to the manifest layout version
FormatVersion and [crate::manifest_blocks::MANIFEST_LAYOUT_VERSION_V1]
evolve at independent cadences:
| Concept | Type | Tracks |
|---|---|---|
FormatVersion | This enum (V1..V5) | Block / SST on-disk layout |
manifest_layout_version | u8 in manifest Footer Block | Manifest file structure (footer fields, TOC encoding, head-mirror geometry) |
A block format bump does NOT force a manifest layout bump and
vice versa. The CURRENT pointer’s canonical digest binds the
manifest layout version (so a manifest-only break is detected
at recovery), and the manifest’s format_version section binds
this enum (so a block-format-only break is detected at
Tree::open).
§Amendment policy
Once a value is published to crates.io (any released binary writes that value to disk), any subsequent change to the on-disk bytes under that value is a breaking change that MUST bump to a new variant. This applies regardless of whether the change is otherwise additive: a reader running the old code is not free to interpret unknown bytes.
The amendment window is the pre-release period: while a
FormatVersion is being actively developed and no published
binary writes it, the on-disk bytes under that version MAY be
amended in place (no enum bump required). The release that
crystallises the variant ends this window.
Same rule applies to manifest_layout_version independently:
pre-publication amendments are free; post-publication changes
require a new layout-version constant.
Practical checklist for any PR that touches on-disk bytes:
- Identify which layer the change touches (Block/SST → this
enum; manifest framing →
manifest_layout_version). - If that layer’s current value has shipped to crates.io, add a new variant / constant instead of amending in place.
- The OTHER layer’s value stays unless its layer also changed.
Variants§
V1 = 1
Version for 1.x.x releases
V2 = 2
Version for 2.x.x releases
V3 = 3
Version for 3.x.x releases
V4 = 4
Version for range-tombstone SST semantics
V5 = 5
Two on-disk changes shipped together in this format version (V5 had not been released when both landed, so they collapse into the same version bump):
-
BuRR(Bumped Ribbon Retrieval) filter wire format. Filter blocks are no longer Bloom-encoded; thefilter_typebyte + per-layer header layout is documented insrc/table/filter/ribbon/burr/wire.rs. -
Per-block transform flags + Page ECC. The self-describing block types (
Meta/Manifest/ManifestFooter) carry ablock_flags: u8byte with the transform-presence bits;ECC_PARITYmarks that a Reed-Solomon parity trailer follows the XXH3-covered payload (its length is derived fromdata_length, not stored). SST block types (Data/Index/Filter/RangeTombstone) keep the compact header WITHOUT this byte: their parity / per-KV-footer presence is a per-SST property read from the table descriptor (page_ecc/kv_checksum_algo), not a serialized header flag.KV_CHECKSUM_FOOTER(set on the self-describing types) marks a per-entry checksum footer. WhenConfig::page_ecc(false)(the default) no parity bytes follow; likewise no footer unless per-KV checksums are enabled. The block magic was bumped to[L,S,M,4](was[L,S,M,3]on pre-V5 versions) so a pre-V5 reader that bypasses the manifest gate fails fast at block header decode rather than misreading the new layout.
V3 / V4 ↔ V5 incompatibility is enforced primarily by the
manifest version gate at Tree::open (returns
InvalidVersion for anything other than V5).
Trait Implementations§
Source§impl Clone for FormatVersion
impl Clone for FormatVersion
Source§fn clone(&self) -> FormatVersion
fn clone(&self) -> FormatVersion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for FormatVersion
Source§impl Debug for FormatVersion
impl Debug for FormatVersion
Source§impl Display for FormatVersion
impl Display for FormatVersion
impl Eq for FormatVersion
Source§impl From<FormatVersion> for u8
impl From<FormatVersion> for u8
Source§fn from(value: FormatVersion) -> Self
fn from(value: FormatVersion) -> Self
Source§impl PartialEq for FormatVersion
impl PartialEq for FormatVersion
Source§fn eq(&self, other: &FormatVersion) -> bool
fn eq(&self, other: &FormatVersion) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for FormatVersion
Auto Trait Implementations§
impl Freeze for FormatVersion
impl RefUnwindSafe for FormatVersion
impl Send for FormatVersion
impl Sync for FormatVersion
impl Unpin for FormatVersion
impl UnsafeUnpin for FormatVersion
impl UnwindSafe for FormatVersion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more