Skip to main content

GEO_INDEX_LIVENESS_KEY

Constant GEO_INDEX_LIVENESS_KEY 

Source
pub const GEO_INDEX_LIVENESS_KEY: &[u8] = b"geo_index_live";
Expand description

The other reserved key in GEO_INDEX_META_CF: the rebuild LIVENESS marker, holding the epoch it was stamped with (8-byte big-endian).

Why a second key: the epoch must be able to OUTLIVE the index. An operator wiping the geo_index CF, or a rebuild that took the lease and died mid-walk, leaves the postings empty while geo_index_epoch still reads as stamped — and a trusted-but-empty index answers every geof:* rewrite with zero rows. That is the §10 forbidden class, and the missing-epoch-untrusted gate does not cover it because the epoch is still there.

So the marker lives beside the epoch, and wipe_geo_index clears the MARKER (not the epoch). The two are written together by set_geo_index_epoch and read together by geo_index_epoch, which reports None — untrusted, exactly like a missing epoch — unless both are present and agree. This also keeps the ESTIMATES flowing: the marker gates only the rewrite’s trust decision, never anything a sketch or a placeholder density needs.