Expand description
Compaction (M2): rebuild the index without tombstoned rows and without the name bytes renames abandoned in the pools. Without it both grow forever under USN traffic and eventually eat the B/entry RAM budget.
The whole trick is the remapping order: live entries keep their relative
id order (old-id ascending β new ids 0..live). Every sorted structure
orders by (key, id) with identical keys on both sides, so filtering the
dead and renumbering the survivors preserves sortedness β perm_name
and the FRN index copy over in O(n) with no re-sort (ADR-0009).
Swap-in goes through VolumeSlot::install_index, which bumps the
structural generation: open result handles go hard-stale and the UI
re-issues its query (docs/ARCHITECTURE.md, generation 2-tier).
ConstantsΒ§
- COMPACT_
DEAD_ πNAME_ BYTES - Reclaimable pool bytes that trigger compaction regardless of ratio.
- COMPACT_
MIN_ πENTRIES - Below this size the garbage canβt be worth a rebuild.
- COMPACT_
TOMBSTONE_ πRATIO - Tombstone share that triggers compaction (matches the
OffsetTableβs stale-rebuild instinct: past ~1/8 dead weight, rebuilding wins).