{"record":{"id":"7b50c4f86131ca39","repo":"apache/hadoop","slug":"new-block-position-must-be-greater-than-the-las","errorCode":null,"errorMessage":"New block position {} must be greater than the last block position {} for path {}","messagePattern":"New block position (.+?) must be greater than the last block position (.+?) for path (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AzureBlobBlockManager.java","lineNumber":142,"sourceCode":"    }\n    return committedBlockIdList;\n  }\n\n  /**\n   * Adds a new block entry to the block entry list.\n   * The block entry is added only if the position of the new block\n   * is greater than the position of the last block in the list.\n   *\n   * @param blockId The ID of the new block to be added.\n   * @param position The position of the new block in the stream.\n   * @return The newly added {@link BlockEntry}.\n   * @throws IOException If the position of the new block is not greater than the last block in the list.\n   */\n  private synchronized BlockEntry addNewEntry(String blockId, long position) throws IOException {\n    if (!blockEntryList.isEmpty()) {\n      BlockEntry lastEntry = blockEntryList.getLast();\n      if (position <= lastEntry.getPosition()) {\n        throw new IOException(\"New block position \" + position  + \" must be greater than the last block position \"\n            + lastEntry.getPosition() + \" for path \" + getAbfsOutputStream().getPath());\n      }\n    }\n    BlockEntry blockEntry = new BlockEntry(blockId, position, AbfsBlockStatus.NEW);\n    blockEntryList.addLast(blockEntry);\n    LOG.debug(\"Added block {} at position {} with status NEW.\", blockId, position);\n    return blockEntry;\n  }\n\n  /**\n   * Updates the status of an existing block entry to SUCCESS.\n   * This method is used to mark a block as successfully processed.\n   *\n   * @param block The {@link AbfsBlock} whose status needs to be updated to SUCCESS.\n   */\n  protected synchronized void updateEntry(AbfsBlock block) {\n    BlockEntry blockEntry = block.getBlockEntry();\n    blockEntry.setStatus(AbfsBlockStatus.SUCCESS);","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AzureBlobBlockManager.java#L124-L160","documentation":"Error \"New block position {} must be greater than the last block position {} for path {}\" thrown in apache/hadoop.","triggerScenarios":"A new block is added at a position not greater than the previous block, indicating concurrent or out-of-order writes.","commonSituations":"See trigger scenarios.","solutions":["Ensure blocks are committed in strictly increasing position order for the file.","Avoid concurrent writers to the same path, which interleave block positions."],"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-22T20:17:22.307Z"}