{"record":{"id":"b75ee06c40a689b0","repo":"apache/hadoop","slug":"block-pool-bpid-is-not-found-b75ee0","errorCode":null,"errorMessage":"block pool {bpid} is not found","messagePattern":"block pool (.+?) is not found","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/FsVolumeImpl.java","lineNumber":565,"sourceCode":"\n  @VisibleForTesting\n  long getRecentReserved() {\n    return recentReserved;\n  }\n\n  public Map<String, BlockPoolSlice> getBlockPoolSlices() {\n    return bpSlices;\n  }\n\n  long getReserved(){\n    return reserved != null ? reserved.getReserved() : 0;\n  }\n\n  @VisibleForTesting\n  BlockPoolSlice getBlockPoolSlice(String bpid) throws IOException {\n    BlockPoolSlice bp = bpSlices.get(bpid);\n    if (bp == null) {\n      throw new IOException(\"block pool \" + bpid + \" is not found\");\n    }\n    return bp;\n  }\n\n  @Override\n  public URI getBaseURI() {\n    return baseURI;\n  }\n\n  @Override\n  public DF getUsageStats(Configuration conf) {\n    if (currentDir != null) {\n      try {\n        return new DF(new File(currentDir.getParent()), conf);\n      } catch (IOException e) {\n        LOG.error(\"Unable to get disk statistics for volume {}\", this, e);\n      }\n    }","sourceCodeStart":547,"sourceCodeEnd":583,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/FsVolumeImpl.java#L547-L583","documentation":"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.","triggerScenarios":"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.","commonSituations":"DN restart while jobs run; adding or removing nameservices; transient errors right after NameNode registration; usually retried by the caller.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!volume.getBlockPoolSlices().containsKey(bpid)) {\n  // BP slice not ready or removed: retry after registration completes\n  return;\n}\nBlockPoolSlice slice = volume.getBlockPoolSlice(bpid);","typeGuard":null,"tryCatchPattern":"try {\n  BlockPoolSlice bp = volume.getBlockPoolSlice(bpid);\n} catch (IOException e) {\n  if (e.getMessage().contains(\"is not found\")) {\n    // wait for 'Adding block pool' then retry\n  }\n}","preventionTips":["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."],"tags":["hdfs","datanode","block-pool","registration","race-condition"],"backgroundTag":"block-pool-not-found","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}