Expand description
R-tree checkpoint/restore for durable persistence.
§On-disk framing
Plaintext R-tree checkpoints start with the 6-byte magic RKSPT\0.
The first 4 bytes are never SEGV, so detection is unambiguous.
Encrypted checkpoints use the same SEGV framing as the vector engine:
[SEGV (4B)] [version_u16_le (2B)] [cipher_alg_u8 (1B)] [kid_u8 (1B)]
[epoch (4B)] [reserved (4B)] [AES-256-GCM ciphertext of the inner payload]The inner payload is either the raw rkyv bytes for R-tree or the msgpack
bytes for geohash — the existing plaintext format. The nonce is
(epoch, lsn=0), and the 16-byte preamble is used as AAD.
Storage key scheme (in redb under Namespace::Spatial):
{collection}\x00{field}\x00rtree→ serialized R-tree entries{collection}\x00{field}\x00meta→ SpatialIndexMeta
Structs§
- Spatial
Index Meta - Metadata for a persisted spatial index.
Enums§
- RTree
Checkpoint Error - Errors during R-tree checkpoint operations.
- Spatial
Index Type - Type of spatial index.
Constants§
- RTREE_
FORMAT_ VERSION - Current format version for rkyv-serialized R-tree snapshots.
Functions§
- deserialize_
meta - Deserialize index metadata from bytes.
- meta_
storage_ key - Build the storage key for spatial index metadata.
- rtree_
storage_ key - Build the storage key for an R-tree checkpoint.
- serialize_
meta - Serialize index metadata to bytes.