Skip to main content

cross_reference_index

Function cross_reference_index 

Source
pub fn cross_reference_index<F: FileBackend>(
    pager: &mut Pager<F>,
    collection: &str,
    index: &IndexDescriptor,
    primary_ids: &HashSet<u64>,
    referenced_ids: &mut HashSet<u64>,
    failures: &mut Vec<IntegrityFailure>,
) -> Result<u64>
Expand description

Verify every entry in an Active index B-tree (Standard, Each, Composite: the trailing 8-byte key suffix is the id; Unique: the value is the id) references a primary id that exists in the primary B-tree.

primary_ids is the set of every id present in the collection’s primary tree (pre-computed by the caller’s primary walk). referenced_ids (out-param) accumulates the set of primary ids referenced by AT LEAST ONE index entry — the caller uses it to run the Primary → Index MissingIndexEntry check.

§Errors

Returns Error::Io on cache-miss read failure. Content-level breakage is recorded into failures and iteration continues.