pub enum ExplodePolicy {
Off,
Graph,
Commits,
Full,
}Expand description
How much of a pack is resolved into the exploded table.
Three values and not a boolean, because a flat off-switch reintroduces a
correctness bug this table exists to fix. Commit and tree payloads used to
live only in RAM, so a clean shutdown came back with every pack’s
indexed bit legitimately set and an EMPTY graph — MEASURED on oden
2026-08-08: 2687 rows and 0 of 551 commits, reachable() returning a
commit instead of its closure and gc seeing an empty live set.
MEASURED on linux.git: resolved content is 16.8 GB against a 6.4 GB pack,
and blobs are nearly all of it. So Graph buys the
correctness fix for a small fraction of the disk, and
Full — one-lookup content reads, thin-pack bases,
and the path columns that make the table a filesystem — is the part worth
charging for.
The default is Commits since lane Q
(2026-08-30), and the change is a measurement. §14’s indexed bit is
derived by comparing this table’s row count against the index’s, so a table
that is deliberately short is indistinguishable, on disk, from one that was
dropped — see [crate::git_ops::Absorber::adopt_journal], which weakens that
comparison for every deliberately-short policy and cannot make it exact
without a durable per-kind count. That weakening is the price of the
default, it is stated here rather than hidden, and it costs a store that
really did lose its table one extra fall-back read per object rather than a
re-ingest.
Variants§
Off
Store nothing. Reads re-resolve, and every pack is re-queued on reopen — which is what rebuilds the graph, since nothing it is folded from is on disk.
Graph
Commits and trees, both eager. The shape lane Q shipped first and
measured: on the real torvalds/linux mirror the tree payloads
alone are 28.24 GB — 3.24× the 8.13 GiB pack — and folding them into
RAM took peak RSS to 50.9 GiB. Kept as a setting, because a small
repository that is read constantly wants exactly this; not the default,
because an appliance ships with 16 GB.
Commits
Commits and tags only — the SHIPPED DEFAULT since lane Q (2026-08-30).
The index-only-at-push shape of
ideas/lazy-explode-index-only-at-push.md, in full. Commits are what
graph and reach fold and what a visibility or pull check reads; a
tag is what a clone peels. Both are small and both stay eager, so
neither ever stalls. Trees and blobs — 90 % of the objects and
essentially all of the bytes — are written into
crate::exploded_cache’s budgeted pool by the FIRST reader that
inflates one, and evicted from it when the budget says so.
Trees became lazy when crate::reach::TreeSource replaced the
resident HashMap<String, Vec<u8>> that crate::serve’s closure walk
and the reachability builder both read. That map was the 28.24 GB above.
MEASURED, torvalds/linux, oden 2026-08-30, /data bytes per pack byte:
eager (Full) | Graph | Commits | |
|---|---|---|---|
| at ack | 1.05× | 1.05× | 1.05× |
| at index-complete | 22.4× (lane P, 78 % done) | 4.58× | see the lane Q rows |
Full
Every object, eagerly, with no bound. What shipped before lane Q and what the 17× measurement is of; kept so a bench can measure the unbounded shape and so a store written under it still opens.
Implementations§
Source§impl ExplodePolicy
impl ExplodePolicy
pub const fn wants(self, kind: GitObjectKind) -> bool
pub const fn as_str(self) -> &'static str
Sourcepub fn parse(s: &str) -> Result<Self>
pub fn parse(s: &str) -> Result<Self>
An unknown value is an ERROR, never a silent fall back to the default: a typo that quietly disables a paid tier is not noticed until a bill is wrong.
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Reads ZNIPPY_GIT_EXPLODE (crate::arms::ENV_EXPLODE) through the
crate’s one counted door, once per store open.
Trait Implementations§
Source§impl Clone for ExplodePolicy
impl Clone for ExplodePolicy
impl Copy for ExplodePolicy
Source§impl Debug for ExplodePolicy
impl Debug for ExplodePolicy
Source§impl Default for ExplodePolicy
impl Default for ExplodePolicy
impl Eq for ExplodePolicy
Source§impl PartialEq for ExplodePolicy
impl PartialEq for ExplodePolicy
impl StructuralPartialEq for ExplodePolicy
Auto Trait Implementations§
impl Freeze for ExplodePolicy
impl RefUnwindSafe for ExplodePolicy
impl Send for ExplodePolicy
impl Sync for ExplodePolicy
impl Unpin for ExplodePolicy
impl UnsafeUnpin for ExplodePolicy
impl UnwindSafe for ExplodePolicy
Blanket Implementations§
impl<T> Allocation for T
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.