{"record":{"id":"c1f6c04e49a478ce","repo":"apache/hadoop","slug":"gap-in-transactions-expected-to-be-able-to-read-u","errorCode":null,"errorMessage":"Gap in transactions. Expected to be able to read up until at least txid %d but unable to find any edit logs containing txid %d","messagePattern":"Gap in transactions\\. Expected to be able to read up until at least txid (.+?) but unable to find any edit logs containing txid (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java","lineNumber":1827,"sourceCode":"    while (true) {\n      if (txId > toAtLeastTxId) return;\n      if (!iter.hasNext()) break;\n      EditLogInputStream elis = iter.next();\n      if (elis.getFirstTxId() > txId) break;\n      long next = elis.getLastTxId();\n      if (next == HdfsServerConstants.INVALID_TXID) {\n        if (!inProgressOk) {\n          throw new RuntimeException(\"inProgressOk = false, but \" +\n              \"selectInputStreams returned an in-progress edit \" +\n              \"log input stream (\" + elis + \")\");\n        }\n        // We don't know where the in-progress stream ends.\n        // It could certainly go all the way up to toAtLeastTxId.\n        return;\n      }\n      txId = next + 1;\n    }\n    throw new IOException(String.format(\"Gap in transactions. Expected to \"\n        + \"be able to read up until at least txid %d but unable to find any \"\n        + \"edit logs containing txid %d\", toAtLeastTxId, txId));\n  }\n\n  /** \n   * Close all the streams in a collection\n   * @param streams The list of streams to close\n   */\n  static void closeAllStreams(Iterable<EditLogInputStream> streams) {\n    for (EditLogInputStream s : streams) {\n      IOUtils.closeStream(s);\n    }\n  }\n\n  /**\n   * Retrieve the implementation class for a Journal scheme.\n   * @param conf The configuration to retrieve the information from\n   * @param uriScheme The uri scheme to look up.","sourceCodeStart":1809,"sourceCodeEnd":1845,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java#L1809-L1845","documentation":"Error \"Gap in transactions. Expected to be able to read up until at least txid %d but unable to find any edit logs containing txid %d\" thrown in apache/hadoop.","triggerScenarios":"Loading edits where a transaction range is missing from all available edit logs, leaving a gap in the transaction sequence.","commonSituations":"See trigger scenarios.","solutions":["Recover missing edit log segments from other journals or the standby NameNode.","If the gap cannot be recovered, run the NameNode recovery mode (hdfs namenode -recover) or restore from a checkpoint, accepting possible data loss."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}