{"record":{"id":"84ebf680f1dca6a9","repo":"RyanCodrai/turbovec","slug":"src-the-newest-commit-generation-newest-is","errorCode":null,"errorMessage":"{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","messagePattern":"(.+?): the newest commit \\(generation (.+?)\\) is incomplete — its sync did not finish — so generation (.+?) was loaded instead; changes made after that commit are lost","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"turbovec/src/io_v7.rs","lineNumber":1430,"sourceCode":"    // disk before its data fails this and the other slot wins.\n    let delta_ok = |h: &ParsedHdr| -> bool {\n        delta_verified(h, geo.unit_len(), |b, d| {\n            let at = geo.unit_at(b);\n            raw.get(at..at + geo.unit_len()).map(|u| d.push(u)).is_some()\n        })\n    };\n    let mut cands: Vec<ParsedHdr> =\n        [parse_hdr(0), parse_hdr(1)].into_iter().flatten().collect();\n    cands.sort_by_key(|h| std::cmp::Reverse(h.gen));\n    let newest = cands.first().map(|h| h.gen);\n    let Some(chosen) = cands.into_iter().find(delta_ok) else {\n        return Err(bad(\"no valid commit header — unrecoverable v7 file\"));\n    };\n    // Falling back is the protocol working, but it is also data loss:\n    // the newest commit's own sync did not finish, and everything it\n    // held is gone. Silence here reads as a clean load.\n    if newest.is_some_and(|g| g != chosen.gen) {\n        crate::warning::warn(&format!(\n            \"{}: the newest commit (generation {}) is incomplete — its sync did \\\n             not finish — so generation {} was loaded instead; changes made after \\\n             that commit are lost\",\n            src,\n            newest.expect(\"checked\"),\n            chosen.gen,\n        ));\n    }\n    let gen = chosen.gen;\n    let n_vectors = chosen.n;\n    // The lazy sentinel is only legal with no rows: without a committed\n    // dimension a row has no geometry.\n    if dim == 0 && n_vectors != 0 {\n        return Err(bad(format!(\n            \"dim 0 with {n_vectors} rows: no dimension committed\"\n        )));\n    }\n","sourceCodeStart":1412,"sourceCodeEnd":1448,"githubUrl":"https://github.com/RyanCodrai/turbovec/blob/ccab9f325e6ce2a270a87daf01ae4e443bcf2d49/turbovec/src/io_v7.rs#L1412-L1448","documentation":"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.","triggerScenarios":"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.","commonSituations":"Killing the writer process during save; power loss or OOM during commit; disk-full aborting a sync halfway.","solutions":["Accept the fallback and re-run the writes/commits that were lost","Restore the index from backup if the lost generation is unacceptable","Always commit via the library's atomic sync path and let the process finish","Monitor for this warning in logs to detect crash-during-commit incidents"],"exampleFix":"// before\nlet idx = Index::load_v7(\"index.tv\")?; // silently 1 generation behind\n// after\nlet idx = Index::load_v7(\"index.tv\");\nmatch idx {\n    Ok(i) if warnings_contain(\"incomplete\") => {\n        log::error!(\"lost newest commit; re-running ingestion\");\n        reingest_and_commit(&i)?;\n    }\n    Ok(i) => Ok(i),\n    Err(e) => Err(e),\n}","handlingStrategy":"try-catch","validationCode":"// after loading, compare loaded generation vs latest known commit\nlet (idx, warnings) = capture_warnings(|| Index::load_v7(path));\nif warnings.iter().any(|w| w.contains(\"is incomplete\")) {\n    log::error!(\"newest commit lost; re-run ingestion\");\n}","typeGuard":"fn loaded_newest(warnings: &[String]) -> bool {\n    !warnings.iter().any(|w| w.contains(\"is incomplete\"))\n}","tryCatchPattern":"let idx = Index::load_v7(path);\nmatch idx {\n    Ok(i) => {\n        if recent_warnings_contain(\"is incomplete\") {\n            eprintln!(\"fell back to older generation; re-running lost writes\");\n            reingest(&i)?;\n        }\n        Ok(i)\n    }\n    Err(e) => Err(e),\n}","preventionTips":["Let commits finish; avoid SIGKILL during sync","Monitor logs for this warning as a crash-during-commit signal","Keep backups or re-run ingestion pipelines idempotently","Ensure adequate disk space so commits are not truncated"],"tags":["durability","crash-recovery","v7","warning"],"backgroundTag":"checksum-mismatch","analyzedSha":"ccab9f325e6ce2a270a87daf01ae4e443bcf2d49","analyzedAt":"2026-09-06T08:39:18.516Z","contentChangedAt":"2026-09-06T08:39:18.516Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}