apache/hadoop · error · IOException

No volume for bpid: {bpid}, block: {replicaInfo}

Error message

No volume for bpid: {bpid}, block: {replicaInfo}

What it means

IOException thrown by FsDatasetImpl.finalizeReplica when the replica being finalized has no associated FsVolumeImpl (replicaInfo.getVolume() returns null). The volume reference is needed to call v.addFinalagedBlock (on-disk upgrade of the replica to FINALIZED state). A null volume means the replica's in-memory entry was detached from its storage location.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java:2062

        bpid, replicaInfo.getStorageUuid(),
        datasetSubLockStrategy.blockIdToSubLock(replicaInfo.getBlockId()))) {
      // Compare generation stamp of old and new replica before finalizing
      if (volumeMap.get(bpid, replicaInfo.getBlockId()).getGenerationStamp()
          > replicaInfo.getGenerationStamp()) {
        throw new IOException("Generation Stamp should be monotonically "
            + "increased bpid: " + bpid + ", block: " + replicaInfo);
      }

      ReplicaInfo newReplicaInfo = null;
      if (replicaInfo.getState() == ReplicaState.RUR &&
          replicaInfo.getOriginalReplica().getState()
          == ReplicaState.FINALIZED) {
        newReplicaInfo = replicaInfo.getOriginalReplica();
        ((FinalizedReplica)newReplicaInfo).loadLastPartialChunkChecksum();
      } else {
        FsVolumeImpl v = (FsVolumeImpl)replicaInfo.getVolume();
        if (v == null) {
          throw new IOException("No volume for bpid: " + bpid + ", block: " + replicaInfo);
        }

        newReplicaInfo = v.addFinalizedBlock(
            bpid, replicaInfo, replicaInfo, replicaInfo.getBytesReserved());
        if (replicaInfo instanceof ReplicaInPipeline) {
          ((ReplicaInPipeline) replicaInfo).releaseReplicaInfoBytesReserved();
        }
        if (v.isTransientStorage()) {
          releaseLockedMemory(
              replicaInfo.getOriginalBytesReserved()
                  - replicaInfo.getNumBytes(),
              false);
          ramDiskReplicaTracker.addReplica(
              bpid, replicaInfo.getBlockId(), v, replicaInfo.getNumBytes());
          datanode.getMetrics().addRamDiskBytesWrite(replicaInfo.getNumBytes());
        }
      }
      assert newReplicaInfo.getState() == ReplicaState.FINALIZED

View on GitHub (pinned to 2add963021)

Solutions

  1. Check DataNode storage health and that all configured data directories are mounted and writable.
  2. Restart the DataNode so the volume map is rebuilt only from live volumes; the NameNode will re-replicate blocks on the missing volume.
  3. Ensure dfs.datanode.data.dir did not shrink between restarts without decommissioning the removed volumes.
  4. If one volume keeps failing, remove it from configuration, restart, and replace the drive.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  dataset.finalizeBlock(b, fsyncDir);
} catch (IOException e) {
  if (e.getMessage() != null && e.getMessage().startsWith("No volume for bpid")) {
    // volume detached under the replica: disk/volume-level incident, escalate
    volumeFailureAlert(b, e);
  }
  throw e;
}

Prevention

When it happens

Trigger: finalizeReplica on a replica whose volume was removed - e.g., after disk failure handling cleared the volume reference, after volume deletion during config change, or for a replica reconstructed from a stale volumeMap entry during upgrade.

Common situations: Disk failed or was unmounted under dfs.datanode.data.dir; DataNode restarted with fewer volumes configured while old replicas linger in memory; hot-swap of storage directories racing a finalize; PROVIDED-storage replicas mishandled in older versions.

Related errors


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