{"record":{"id":"712bb418da8874b3","repo":"microsoft/FASTER","slug":"invalid-log-commit-metadata-for-id","errorCode":null,"errorMessage":"Invalid log commit metadata for ID ","messagePattern":"Invalid log commit metadata for ID ","errorType":"exception","errorClass":"FasterException","httpStatus":null,"severity":"error","filePath":"cs/src/core/Index/Common/Contexts.cs","lineNumber":560,"sourceCode":"                throw new FasterException(\"Invalid checksum for checkpoint\");\n        }\n\n        /// <summary>\n        ///  Recover info from token\n        /// </summary>\n        /// <param name=\"token\"></param>\n        /// <param name=\"checkpointManager\"></param>\n        /// <param name=\"deltaLog\"></param>\n        /// <param name = \"scanDelta\">\n        /// whether to scan the delta log to obtain the latest info contained in an incremental snapshot checkpoint.\n        /// If false, this will recover the base snapshot info but avoid potentially expensive scans.\n        /// </param>\n        /// <param name=\"recoverTo\"> specific version to recover to, if using delta log</param>\n        internal void Recover(Guid token, ICheckpointManager checkpointManager, DeltaLog deltaLog = null, bool scanDelta = false, long recoverTo = -1)\n        {\n            var metadata = checkpointManager.GetLogCheckpointMetadata(token, deltaLog, scanDelta, recoverTo);\n            if (metadata == null)\n                throw new FasterException(\"Invalid log commit metadata for ID \" + token.ToString());\n            using StreamReader s = new(new MemoryStream(metadata));\n            Initialize(s);\n        }\n\n        /// <summary>\n        ///  Recover info from token\n        /// </summary>\n        /// <param name=\"token\"></param>\n        /// <param name=\"checkpointManager\"></param>\n        /// <param name=\"deltaLog\"></param>\n        /// <param name=\"commitCookie\"> Any user-specified commit cookie written as part of the checkpoint </param>\n        /// <param name = \"scanDelta\">\n        /// whether to scan the delta log to obtain the latest info contained in an incremental snapshot checkpoint.\n        /// If false, this will recover the base snapshot info but avoid potentially expensive scans.\n        /// </param>\n        /// <param name=\"recoverTo\"> specific version to recover to, if using delta log</param>\n\n        internal void Recover(Guid token, ICheckpointManager checkpointManager, out byte[] commitCookie, DeltaLog deltaLog = null, bool scanDelta = false, long recoverTo = -1)","sourceCodeStart":542,"sourceCodeEnd":578,"githubUrl":"https://github.com/microsoft/FASTER/blob/321d872eabda6a0345c8bd76419f89723ed864ae/cs/src/core/Index/Common/Contexts.cs#L542-L578","documentation":"LogCheckpointInfo.Recover fetches the log checkpoint metadata for the given token via checkpointManager.GetLogCheckpointMetadata and throws FasterException(\"Invalid log commit metadata for ID \" + token) when the manager returns null. No metadata exists for that token, so recovery cannot proceed.","triggerScenarios":"Calling fasterLog.Recover(token) (or Recover with a checkpoint manager) where GetLogCheckpointMetadata(token, deltaLog, scanDelta, recoverTo) returns null — the token has no committed metadata on the checkpoint manager.","commonSituations":"Recovering with a token from a checkpoint that never fully committed; using the wrong ICheckpointManager/storage backend than the one that wrote the checkpoint; token typo or checkpoint garbage-collected (CheckpointManager pruning old checkpoints); scanning deltas that were never flushed.","solutions":["Verify the token exists: list available checkpoints on the ICheckpointManager and recover with one of those tokens.","Point recovery at the same checkpoint manager backend (path/container) used at checkpoint time.","Check that the checkpoint actually completed (WaitForCommitComplete) before trying to recover from it.","If the delta-scan path returns null, recover from the latest full checkpoint metadata instead (scanDelta=false)."],"exampleFix":"// before\nfasterLog.Recover(unknownToken); // FasterException: Invalid log commit metadata for ID ...\n\n// after\nvar tokens = manager.GetCheckpointTokens(); // e.g. available committed checkpoints\nvar valid = tokens.Contains(token) ? token : tokens.Max();\nfasterLog.Recover(valid);","handlingStrategy":"validation","validationCode":"// confirm the token exists on the manager before recovering\nvar tokens = checkpointManager.GetCheckpointTokens();\nif (!tokens.Contains(token)) throw new InvalidOperationException($\"Unknown checkpoint token {token}; available: {string.Join(\",\", tokens)}\");","typeGuard":null,"tryCatchPattern":"try { fasterLog.Recover(token); } catch (FasterException ex) when (ex.Message.StartsWith(\"Invalid log commit metadata for ID\")) { fasterLog.Recover(latestCommittedToken); }","preventionTips":["Always WaitForCommitComplete before recording a token as recoverable.","Use the same checkpoint-manager backend and path for write and recovery.","Disable/lengthen checkpoint pruning if tokens may be recovered later."],"tags":["checkpoint","recovery","missing-metadata","fasterlog"],"backgroundTag":"record-not-found","analyzedSha":"321d872eabda6a0345c8bd76419f89723ed864ae","analyzedAt":"2026-09-15T22:18:00.693Z","contentChangedAt":"2026-09-15T22:18:00.693Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}