Skip to main content

Module checkpoint

Module checkpoint 

Source
Expand description

Checkpoint serialization and restoration for [SpatialIndexManager].

Persists the full in-memory spatial state to Namespace::Spatial so that a cold open can load the index without rebuilding from CRDT documents.

§Key layout under Namespace::Spatial

KeyValue
spatial:_collectionsMessagePack Vec<(String, String)> — (collection, field) pairs
spatial:{collection}:{field}:docmapMessagePack Vec<(String, u64)> — doc_id → entry_id
spatial:_next_idMessagePack u64 — next entry ID

The R-tree blob (spatial:{collection}:{field}:rtree) is stored in a pagedb segment when as_spatial_segment_ext() is available, or falls back to the Namespace::Spatial KV path (e.g. WASM). In both cases the bytes stored are the CRC32C-wrapped R-tree checkpoint produced by crate::storage::checksum::wrap.