Skip to main content

Module geo_upgrade

Module geo_upgrade 

Source
Expand description

The cluster geo index upgrade/rebuild driver (the RPC shell of waratah_geo::rebuild’s core): takes the partition lease, streams geo terms via prefix-filtered head scans, upgrades orphaned typed literals (ReplaceQuads across all three axes at a swap ts derived from the walked data — 1 + the max ts under the discovery prefixes), covers the now-homogeneously-native store, and finishes — refreshing the lease per batch so a slow walk is never taken over. Startup blocks on this; a failure leaves the epoch unstamped (the untrusted gate keeps queries correct via the residual path), and a crashed driver’s stale lease is force-takeable by the next attempt.

Constants§

HEAD_PAGE 🔒
Head-scan page size (terms per RPC; the walk resumes per term).
REPLACE_CHUNK 🔒
Replace pairs per ReplaceQuads call (the client byte-frames anyway; this keeps one call’s pair count bounded for log readability).
TRIPLE_CHUNK 🔒
Orphan triples fetched per filtered-scan drain.
TYPE_BIG_TYPED_LITERAL 🔒
TYPE_LITERAL_GEOMETRY 🔒
TYPE_LITERAL_POINT 🔒
TYPE_SMALL_TYPED_LITERAL 🔒

Functions§

drive_geo_upgrade
Drive one geo index rebuild/upgrade against a running cluster.
fetch_blobs 🔒
Fetch blob payloads through the registry client (batched), returning (id, payload) pairs for the hits.
flush_replaces 🔒
Flush replace pairs in bounded batches at the upgrade ts.
geo_head_prefixes
The six discovery prefixes: native geo term type bytes plus the orphaned typed-literal forms (type byte + the geo datatype-IRI hash, which sits at a fixed offset in both typed-literal encodings). The typed-literal type bytes are NEVER listed bare: the scan’s prefix normalization (prepare_head_prefixes) drops a longer prefix subsumed by a kept shorter one, so a bare [24] / [25] would swallow the four datatype-named prefixes below and widen the head walk to every typed literal in the store.
plan_orphan 🔒
Plan one orphan’s upgrade: resolve its lexical (inline for SmallTypedLiteral, the string registry for BigTypedLiteral), then parse/validate/transform through the shared ingest path. Any failure is a hard rebuild error: stamping an epoch after skipping the orphan would make the trusted candidate index incomplete.
status_to_compute 🔒