apache/hadoop · error · IOException
block pool {bpid} is not found
Error message
block pool {bpid} is not found What it means
FsVolumeImpl.getBlockPoolSlice(bpid) returns this volume's per-block-pool storage; the IOException fires when the bpid is absent from bpSlices - the volume has not (yet) created the block pool directory, or the pool was already removed. Operations touching blocks of a freshly registered or freshly retired NameNode hit this race.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java:565
@VisibleForTesting
long getRecentReserved() {
return recentReserved;
}
public Map<String, BlockPoolSlice> getBlockPoolSlices() {
return bpSlices;
}
long getReserved(){
return reserved != null ? reserved.getReserved() : 0;
}
@VisibleForTesting
BlockPoolSlice getBlockPoolSlice(String bpid) throws IOException {
BlockPoolSlice bp = bpSlices.get(bpid);
if (bp == null) {
throw new IOException("block pool " + bpid + " is not found");
}
return bp;
}
@Override
public URI getBaseURI() {
return baseURI;
}
@Override
public DF getUsageStats(Configuration conf) {
if (currentDir != null) {
try {
return new DF(new File(currentDir.getParent()), conf);
} catch (IOException e) {
LOG.error("Unable to get disk statistics for volume {}", this, e);
}
}View on GitHub (pinned to 2add963021)
Solutions
- Retry after registration settles - addBlockPool creates the slice during handshake; watch for 'Adding block pool' in the DN log.
- Verify the NN's cluster ID and block pool ID match the DN's; a mismatched VERSION prevents BP creation.
- If the BP was retired, ensure clients stop referencing it (refresh nameservices on clients).
- Persistent occurrence with a valid bpid means the BP dir failed to create - check permissions and space under the volume.
Defensive patterns
Strategy: validation
Validate before calling
if (!volume.getBlockPoolSlices().containsKey(bpid)) {
// BP slice not ready or removed: retry after registration completes
return;
}
BlockPoolSlice slice = volume.getBlockPoolSlice(bpid); Try / catch
try {
BlockPoolSlice bp = volume.getBlockPoolSlice(bpid);
} catch (IOException e) {
if (e.getMessage().contains("is not found")) {
// wait for 'Adding block pool' then retry
}
} Prevention
- Retry block requests shortly after NN registration; BP slices are created during addBlockPool.
- Verify cluster ID and block pool ID match between NN and DN after format/rollback.
- After removing a nameservice, refresh clients so they stop referencing the retired bpid.
When it happens
Trigger: A block request arrives between NN handshake and addBlockPool creating the BP slice; refreshNamenodes adds a nameservice whose slice is still initializing; the BP was deleted but a stale request still references it.
Common situations: DN restart while jobs run; adding or removing nameservices; transient errors right after NameNode registration; usually retried by the caller.
Related errors
- Not ready to serve the block pool, {}.
- DN shut down before block pool registered
- Storage directory for location {} and block pool id {} does
- No block pool offer service for bpid={}
- FsDatasetSpi has not been initialized
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/b75ee06c40a689b0.
Report an issue: GitHub.