{"record":{"id":"183e0a8c6a37ef93","repo":"apache/hadoop","slug":"bad-edit-log-manifest-expected-txid-expectedt","errorCode":null,"errorMessage":"Bad edit log manifest (expected txid = ${expectedTxId}: ${manifest}","messagePattern":"Bad edit log manifest \\(expected txid = (.+?): (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java","lineNumber":405,"sourceCode":"   * @throws IOException\n   */\n  static boolean downloadCheckpointFiles(\n      final URL nnHostPort,\n      final FSImage dstImage,\n      final CheckpointSignature sig,\n      final RemoteEditLogManifest manifest\n  ) throws IOException {\n    \n    // Sanity check manifest - these could happen if, eg, someone on the\n    // NN side accidentally rmed the storage directories\n    if (manifest.getLogs().isEmpty()) {\n      throw new IOException(\"Found no edit logs to download on NN since txid \" \n          + sig.mostRecentCheckpointTxId);\n    }\n    \n    long expectedTxId = sig.mostRecentCheckpointTxId + 1;\n    if (manifest.getLogs().get(0).getStartTxId() != expectedTxId) {\n      throw new IOException(\"Bad edit log manifest (expected txid = \" +\n          expectedTxId + \": \" + manifest);\n    }\n\n    try {\n        Boolean b = UserGroupInformation.getCurrentUser().doAs(\n            new PrivilegedExceptionAction<Boolean>() {\n  \n          @Override\n          public Boolean run() throws Exception {\n            dstImage.getStorage().cTime = sig.cTime;\n\n            // get fsimage\n            if (sig.mostRecentCheckpointTxId ==\n                dstImage.getStorage().getMostRecentCheckpointTxId()) {\n              LOG.info(\"Image has not changed. Will not download image.\");\n            } else {\n              LOG.info(\"Image has changed. Downloading updated image from NN.\");\n              MD5Hash downloadedHash = TransferFsImage.downloadImageToStorage(","sourceCodeStart":387,"sourceCodeEnd":423,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/SecondaryNameNode.java#L387-L423","documentation":"Thrown by downloadCheckpointFiles when the manifest's first log does not start at the expected txid (mostRecentCheckpointTxId + 1) — a gap exists between the checkpoint and the available edits, making the image+edits pair inconsistent.","triggerScenarios":"The downloaded edit log manifest does not start at the expected transaction ID.","commonSituations":"Partially failed edits transfer or mixed storage directories with divergent txid ranges.","solutions":["Check JournalNode/NameNode edit log health and storage; a corrupted or inconsistent edit manifest indicates missing or damaged edit segments."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}