{"record":{"id":"059af4e1fa143a81","repo":"microsoft/FASTER","slug":"invalid-version-found-during-commit-recovery","errorCode":null,"errorMessage":"Invalid version found during commit recovery","messagePattern":"Invalid version found during commit recovery","errorType":"exception","errorClass":"FasterException","httpStatus":null,"severity":"critical","filePath":"cs/src/core/FasterLog/FasterLogRecoveryInfo.cs","lineNumber":94,"sourceCode":"            int version;\n            long checkSum;\n            try\n            {\n                version = reader.ReadInt32();\n                checkSum = reader.ReadInt64();\n                BeginAddress = reader.ReadInt64();\n                UntilAddress = reader.ReadInt64();\n                if (version > 0)\n                    CommitNum = reader.ReadInt64();\n                else\n                    CommitNum = -1;\n            }\n            catch (Exception e)\n            {\n                throw new FasterException(\"Unable to recover from previous commit. Inner exception: \" + e.ToString());\n            }\n            if (version < 0 || version > FasterLogRecoveryVersion)\n                throw new FasterException(\"Invalid version found during commit recovery\");\n\n            var iteratorCount = 0;\n            try\n            {\n                iteratorCount = reader.ReadInt32();\n            }\n            catch { }\n\n            if (iteratorCount > 0)\n            {\n                Iterators = new Dictionary<string, long>();\n                for (int i = 0; i < iteratorCount; i++)\n                {\n                    int len = reader.ReadInt32();\n                    byte[] bytes = reader.ReadBytes(len);\n                    Iterators.Add(Encoding.UTF8.GetString(bytes), reader.ReadInt64());\n                }\n            }","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/microsoft/FASTER/blob/321d872eabda6a0345c8bd76419f89723ed864ae/cs/src/core/FasterLog/FasterLogRecoveryInfo.cs#L76-L112","documentation":"The version stamp read from the persisted commit-recovery metadata is negative or newer than FasterLogRecoveryVersion supported by this build (FasterLogRecoveryInfo.cs:94). The metadata file was written by an incompatible FasterLog version or is corrupt.","triggerScenarios":"Opening a log with a newer FAST# / FasterLog version's commit files, or an older version than wrote them; corrupted first bytes of the metadata stream (e.g., torn write producing a bogus version).","commonSituations":"Rolling upgrades/downgrades across library versions; mixing NuGet package versions in a cluster; a crash that zeroed/garbled the recovery file header.","solutions":["Use the same (or newer, format-compatible) FasterLog library version that wrote the log; align versions across all nodes.","Restore from a checkpoint written by the current version.","If corruption is suspected, inspect the metadata file header; restore the whole log directory from backup.","Plan version migrations by fully committing and checkpointing before upgrading, never swapping library versions mid-life of a log."],"exampleFix":"// before\n// app updated to newer FasterLog, opens log written by old version -> invalid version\n\n// after\n// pin the package version that created the log, or export data via the old\n// version's iterator and import into a fresh log with the new version","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { log = new FasterLog(options); } catch (FasterException ex) when (ex.Message == \"Invalid version found during commit recovery\") { OpenWithCompatibleVersionOrRestore(); }","preventionTips":["Pin FasterLog package versions across the fleet","Checkpoint before upgrading/downgrading the library","Never mix log directories between incompatible versions"],"tags":["fasterlog","recovery","version-mismatch","serialization"],"backgroundTag":"schema-validation-failed","analyzedSha":"321d872eabda6a0345c8bd76419f89723ed864ae","analyzedAt":"2026-09-15T22:18:00.693Z","contentChangedAt":"2026-09-15T22:18:00.693Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}