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.FINALIZEDView on GitHub (pinned to 2add963021)
Solutions
- Check DataNode storage health and that all configured data directories are mounted and writable.
- Restart the DataNode so the volume map is rebuilt only from live volumes; the NameNode will re-replicate blocks on the missing volume.
- Ensure dfs.datanode.data.dir did not shrink between restarts without decommissioning the removed volumes.
- 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
- Keep dfs.datanode.data.dir stable across DataNode restarts; decommission volumes instead of silently dropping them.
- Alert on DataNode volume-failure metrics (VolumeFailures > 0).
- Ensure data directories stay mounted (automount/NFS flaps cause volume loss).
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
- Found fewer bytesOnDisk than bytesAcked for replica {rbw}
- Cannot finalize block: {b} from Interrupted Thread
- Generation Stamp should be monotonically increased bpid: {bp
- {blockURI}
- Failed to delete {count} (out of {total}) replica(s): {error
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/1f855192d7474110.
Report an issue: GitHub.