{"record":{"id":"1f855192d7474110","repo":"apache/hadoop","slug":"no-volume-for-bpid-bpid-block-replicainfo","errorCode":null,"errorMessage":"No volume for bpid: {bpid}, block: {replicaInfo}","messagePattern":"No volume for bpid: (.+?), block: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java","lineNumber":2062,"sourceCode":"        bpid, replicaInfo.getStorageUuid(),\n        datasetSubLockStrategy.blockIdToSubLock(replicaInfo.getBlockId()))) {\n      // Compare generation stamp of old and new replica before finalizing\n      if (volumeMap.get(bpid, replicaInfo.getBlockId()).getGenerationStamp()\n          > replicaInfo.getGenerationStamp()) {\n        throw new IOException(\"Generation Stamp should be monotonically \"\n            + \"increased bpid: \" + bpid + \", block: \" + replicaInfo);\n      }\n\n      ReplicaInfo newReplicaInfo = null;\n      if (replicaInfo.getState() == ReplicaState.RUR &&\n          replicaInfo.getOriginalReplica().getState()\n          == ReplicaState.FINALIZED) {\n        newReplicaInfo = replicaInfo.getOriginalReplica();\n        ((FinalizedReplica)newReplicaInfo).loadLastPartialChunkChecksum();\n      } else {\n        FsVolumeImpl v = (FsVolumeImpl)replicaInfo.getVolume();\n        if (v == null) {\n          throw new IOException(\"No volume for bpid: \" + bpid + \", block: \" + replicaInfo);\n        }\n\n        newReplicaInfo = v.addFinalizedBlock(\n            bpid, replicaInfo, replicaInfo, replicaInfo.getBytesReserved());\n        if (replicaInfo instanceof ReplicaInPipeline) {\n          ((ReplicaInPipeline) replicaInfo).releaseReplicaInfoBytesReserved();\n        }\n        if (v.isTransientStorage()) {\n          releaseLockedMemory(\n              replicaInfo.getOriginalBytesReserved()\n                  - replicaInfo.getNumBytes(),\n              false);\n          ramDiskReplicaTracker.addReplica(\n              bpid, replicaInfo.getBlockId(), v, replicaInfo.getNumBytes());\n          datanode.getMetrics().addRamDiskBytesWrite(replicaInfo.getNumBytes());\n        }\n      }\n      assert newReplicaInfo.getState() == ReplicaState.FINALIZED","sourceCodeStart":2044,"sourceCodeEnd":2080,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsDatasetImpl.java#L2044-L2080","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  dataset.finalizeBlock(b, fsyncDir);\n} catch (IOException e) {\n  if (e.getMessage() != null && e.getMessage().startsWith(\"No volume for bpid\")) {\n    // volume detached under the replica: disk/volume-level incident, escalate\n    volumeFailureAlert(b, e);\n  }\n  throw e;\n}","preventionTips":["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)."],"tags":["hdfs","datanode","finalize","volume-missing","disk-failure"],"backgroundTag":"missing-storage-volume","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}