apache/hadoop · error · IOException

{} is neither a RBW nor a Finalized, r={}

Error message

{} is neither a RBW nor a Finalized, r={}

What it means

Error "{} is neither a RBW nor a Finalized, r={}" thrown in apache/hadoop.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java:3656

      if (null == storedBlock) {
        throw new IOException(b + " not found in datanode.");
      }
      storedGS = storedBlock.getGenerationStamp();
      if (storedGS < b.getGenerationStamp()) {
        throw new IOException(storedGS
            + " = storedGS < b.getGenerationStamp(), b=" + b);
      }
      // Update the genstamp with storedGS
      b.setGenerationStamp(storedGS);
      if (data.isValidRbw(b)) {
        stage = BlockConstructionStage.TRANSFER_RBW;
        LOG.debug("Replica is being written!");
      } else if (data.isValidBlock(b)) {
        stage = BlockConstructionStage.TRANSFER_FINALIZED;
        LOG.debug("Replica is finalized!");
      } else {
        final String r = data.getReplicaString(b.getBlockPoolId(), b.getBlockId());
        throw new IOException(b + " is neither a RBW nor a Finalized, r=" + r);
      }
      visible = data.getReplicaVisibleLength(b);
    }
    //set visible length
    b.setNumBytes(visible);

    if (targets.length > 0) {
      if (LOG.isDebugEnabled()) {
        final String xferTargetsString =
            StringUtils.join(" ", Arrays.asList(targets));
        LOG.debug("Transferring a replica to {}", xferTargetsString);
      }

      final DataTransfer dataTransferTask = new DataTransfer(targets,
          targetStorageTypes, targetStorageIds, b, stage, client);

      @SuppressWarnings("unchecked")
      Future<Void> f = (Future<Void>) this.xferService.submit(dataTransferTask);

View on GitHub (pinned to 2add963021)

Solutions

  1. Use a replica in RBW or FINALIZED state for this operation; replicas being recovered (RUR/RWR) must be handled via the recovery path.
  2. Check why the replica is in an unexpected state (ReplicaState) and complete or abort the ongoing recovery first.

When it happens

Trigger: An updateBlock operation is applied to a replica that is neither RBW nor FINALIZED, e.g., one under recovery.

Common situations: An operation expected an RBW or finalized replica but found another state, typically a race with recovery or deletion. Retry the operation.


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/480a095fd1d7d19e. Report an issue: GitHub.