{"record":{"id":"224fd5d9be1d5b9d","repo":"quickwit-oss/tantivy","slug":"actual-doc-store-version-doc-store-version-max","errorCode":null,"errorMessage":"actual doc store version: {doc_store_version}, max_supported: {DOC_STORE_VERSION}","messagePattern":"actual doc store version: (.+?), max_supported: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/store/footer.rs","lineNumber":31,"sourceCode":"}\n\n/// Serialises the footer to a byte-array\n/// - offset : 8 bytes\n/// - compressor id: 1 byte\n/// - reserved for future use: 15 bytes\nimpl BinarySerializable for DocStoreFooter {\n    fn serialize<W: io::Write + ?Sized>(&self, writer: &mut W) -> io::Result<()> {\n        BinarySerializable::serialize(&DOC_STORE_VERSION, writer)?;\n        BinarySerializable::serialize(&self.offset, writer)?;\n        BinarySerializable::serialize(&self.decompressor.get_id(), writer)?;\n        writer.write_all(&[0; 15])?;\n        Ok(())\n    }\n\n    fn deserialize<R: io::Read>(reader: &mut R) -> io::Result<Self> {\n        let doc_store_version = DocStoreVersion::deserialize(reader)?;\n        if doc_store_version > DOC_STORE_VERSION {\n            panic!(\n                \"actual doc store version: {doc_store_version}, max_supported: {DOC_STORE_VERSION}\"\n            );\n        }\n        let offset = u64::deserialize(reader)?;\n        let compressor_id = u8::deserialize(reader)?;\n        let mut skip_buf = [0; 15];\n        reader.read_exact(&mut skip_buf)?;\n        Ok(DocStoreFooter {\n            offset,\n            doc_store_version,\n            decompressor: Decompressor::from_id(compressor_id),\n        })\n    }\n}\n\nimpl FixedSize for DocStoreFooter {\n    const SIZE_IN_BYTES: usize = 28;\n}","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/quickwit-oss/tantivy/blob/b5d8deb80c26924e6b007a5b1a7630f35ca64de4/src/store/footer.rs#L13-L49","documentation":"Footer::deserialize reads the DocStoreVersion from a segment footer and panics if it is greater than the max version (DOC_STORE_VERSION) this library build supports. This is a forward-compatibility guard: the on-disk format is newer than the reader. Downgrading the library under data written by a newer tantivy triggers it.","triggerScenarios":"Opening a doc store/segment footer whose version byte/integer exceeds DOC_STORE_VERSION of the current crate version — i.e. data written by a newer tantivy release read by an older one.","commonSituations":"Downgrading the tantivy dependency while old indexes remain on disk; a writer service upgraded before reader services sharing the same data directory; using an old library build against files produced by a dev branch.","solutions":["Upgrade tantivy to a version whose DOC_STORE_VERSION >= the file's version (check the footer value in the panic message)","Re-index the data with the older library version if downgrade is mandatory","Ensure all services sharing an index run the same tantivy version","Keep backups/reindex pipelines so format upgrades can be rolled forward"],"exampleFix":"// before\n// panic: actual doc store version: 3, max_supported: 2  (tantivy 0.21 reading 0.22 data)\n// after (Cargo.toml)\ntantivy = \"0.22\" // match the version that wrote the index","handlingStrategy":"validation","validationCode":"let current: u32 = tantivy_version_doc_store_version(); // must be >= footer version\nlet file_version: u32 = read_footer_version(path)?;\nif file_version > current {\n    return Err(format!(\"index written by newer tantivy: v{file_version} > supported v{current}\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin the same tantivy version everywhere the index is read or written","Upgrade readers before (or with) writers when bumping tantivy","Keep reindex tooling to roll data forward on format upgrades","Never downgrade the library under existing index directories"],"tags":["rust","versioning","backward-compatibility","panic","data-format"],"backgroundTag":"schema-version-too-new","analyzedSha":"b5d8deb80c26924e6b007a5b1a7630f35ca64de4","analyzedAt":"2026-09-05T13:20:51.521Z","contentChangedAt":"2026-09-05T13:20:51.521Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}