RyanCodrai/turbovec · warning

{src}: the newest commit (generation {newest}) is incomplete

Error message

{src}: the newest commit (generation {newest}) is incomplete — its sync did not finish — so generation {chosen} was loaded instead; changes made after that commit are lost

What it means

When loading a v7 file, if the newest commit's generation is incomplete (its sync did not finish) the loader falls back to the previous complete generation and emits this warning. Falling back is protocol working as designed, but the newest commit's data is gone, and the warning exists so a silent fallback does not read as a clean load.

Source

Thrown at turbovec/src/io_v7.rs:1430

    // disk before its data fails this and the other slot wins.
    let delta_ok = |h: &ParsedHdr| -> bool {
        delta_verified(h, geo.unit_len(), |b, d| {
            let at = geo.unit_at(b);
            raw.get(at..at + geo.unit_len()).map(|u| d.push(u)).is_some()
        })
    };
    let mut cands: Vec<ParsedHdr> =
        [parse_hdr(0), parse_hdr(1)].into_iter().flatten().collect();
    cands.sort_by_key(|h| std::cmp::Reverse(h.gen));
    let newest = cands.first().map(|h| h.gen);
    let Some(chosen) = cands.into_iter().find(delta_ok) else {
        return Err(bad("no valid commit header — unrecoverable v7 file"));
    };
    // Falling back is the protocol working, but it is also data loss:
    // the newest commit's own sync did not finish, and everything it
    // held is gone. Silence here reads as a clean load.
    if newest.is_some_and(|g| g != chosen.gen) {
        crate::warning::warn(&format!(
            "{}: the newest commit (generation {}) is incomplete — its sync did \
             not finish — so generation {} was loaded instead; changes made after \
             that commit are lost",
            src,
            newest.expect("checked"),
            chosen.gen,
        ));
    }
    let gen = chosen.gen;
    let n_vectors = chosen.n;
    // The lazy sentinel is only legal with no rows: without a committed
    // dimension a row has no geometry.
    if dim == 0 && n_vectors != 0 {
        return Err(bad(format!(
            "dim 0 with {n_vectors} rows: no dimension committed"
        )));
    }

View on GitHub (pinned to ccab9f325e)

Solutions

  1. Accept the fallback and re-run the writes/commits that were lost
  2. Restore the index from backup if the lost generation is unacceptable
  3. Always commit via the library's atomic sync path and let the process finish
  4. Monitor for this warning in logs to detect crash-during-commit incidents

Example fix

// before
let idx = Index::load_v7("index.tv")?; // silently 1 generation behind
// after
let idx = Index::load_v7("index.tv");
match idx {
    Ok(i) if warnings_contain("incomplete") => {
        log::error!("lost newest commit; re-running ingestion");
        reingest_and_commit(&i)?;
    }
    Ok(i) => Ok(i),
    Err(e) => Err(e),
}
Defensive patterns

Strategy: try-catch

Validate before calling

// after loading, compare loaded generation vs latest known commit
let (idx, warnings) = capture_warnings(|| Index::load_v7(path));
if warnings.iter().any(|w| w.contains("is incomplete")) {
    log::error!("newest commit lost; re-run ingestion");
}

Type guard

fn loaded_newest(warnings: &[String]) -> bool {
    !warnings.iter().any(|w| w.contains("is incomplete"))
}

Try / catch

let idx = Index::load_v7(path);
match idx {
    Ok(i) => {
        if recent_warnings_contain("is incomplete") {
            eprintln!("fell back to older generation; re-running lost writes");
            reingest(&i)?;
        }
        Ok(i)
    }
    Err(e) => Err(e),
}

Prevention

When it happens

Trigger: Opening a v7 index whose last commit was interrupted (process killed/OOM/crash mid-sync), so the newest generation record is incomplete while an older generation remains valid.

Common situations: Killing the writer process during save; power loss or OOM during commit; disk-full aborting a sync halfway.

Understand the failure class

Background: Checksum mismatch errors: "checksum verification failed", "digest mismatch", "expected vs actual checksum" — what they mean and how to fix them — this error's family across 41 libraries.

Related errors


AI-assisted analysis of RyanCodrai/turbovec@ccab9f325e (2026-09-06). Data as JSON: /api/errors/84ebf680f1dca6a9. Report an issue: GitHub.