Skip to main content

Module migrate

Module migrate 

Source
Expand description

The upgrade’s reduce step: one zone’s output is rewritten into the compact form (SPEC_HISTORY_COMPACT_FORM_ONLY_2026_11_23.md section 9, checks L1 to L4).

The old file is never edited. The worker reads it through snapshots in windows that end at a turn boundary, runs compact::compact_lines on each, checks the result with compact::verify, and appends it to output.next (with output.next.tsidx, the receive times of the lines that were kept, translated to the new offsets). When it has read to the old file’s end, one transaction (FileStore::swap_in_next) checks the old file is still what was read, copies the few lines appended since, and renames the new rows over the old. A crash at any point leaves the old file; a leftover output.next is discarded and the zone starts again.

What is written to output.consol is counts, hashes and the line map, never conversation text: the map is the dropped runs, so that a position in the old file translates exactly to the new one.

This module does not decide when to run (the background pass does) and does not translate positions for readers (the readers’ piece does). Nothing here is on by default.

Re-exports§

pub use super::consol::ByteRun;
pub use super::consol::Map;
pub use super::consol::Run;
pub use super::consol::CONSOL;

Structs§

Options
What a pass does and how fast.
Report
Counts for one zone. No content.

Enums§

Outcome
How a zone’s pass ended.

Constants§

NEXT
The file the compact transcript is built in, beside output.
NEXT_TSIDX
Its receive-time sidecar.

Functions§

migrate_all
Run the pass over every zone of the store under prefix (agent:), one at a time. Returns the reports; a zone’s failure never stops the next.
migrate_zone
Make one zone’s output compact. See the module doc. Safe to call again at any time.