Expand description
Per-volume state: the slot the engine and the worker thread share
(VolumeSlot), the index install rule, the journal checkpoint, and the
snapshot save helper. The thread that drives the flow lives in
worker.rs; the OS-effect seams it runs against live in seams.rs.
Structsยง
- Journal
Checkpoint ๐ - USN position paired with the index state, shared with
Engine::flush. The tailing thread owns the journal handle; โsave nowโ from another thread needs (journal_id,next_usn) without touching it. Updated after a batch is applied, so a concurrent flush that reads the checkpoint first always saves checkpoint โค index โ the USN replay on load covers the gap (re-applying records is idempotent; skipping them would not be). - Volume
Query ๐Cache - Last materialized per-volume result, kept for incremental refinement
(query/subsume.rs) and unchanged-result detection (
QueryTrace:: unchanged). Validity = both generations still match; USN batches invalidate implicitly by bumpingcontent_generation. - Volume
Slot ๐
Enumsยง
- Worker
Kind ๐ - What drives a volume slot: the privileged $MFT scan + USN journal, or the
non-elevated folder-walk +
ReadDirectoryChangesWwatcher (scope mode, ADR-0024). The worker reuses one loop for both; this picks the initial-scan source and the change source at the two branch points.
Functionsยง
- is_
valid_ ๐volume_ label - A drive label is exactly one ASCII letter followed by
':'(โC:โ, โd:โ) โ the shapelist_ntfs_volumesproduces andsnapshot_pathexpects. This is the trust boundary forEngine::index_start: validating here bounds the set of distinct labels to a small finite set (so a hostile caller canโt spawn unbounded volume threads) and stops a label bearing..\or path separators from steeringsnapshot_pathoutside the index directory. - snapshot_
path ๐ {index_dir}\{drive-letter}.fmfidxโ the path each volumeโsWinSnapshotStoreis built on.