apache/hadoop · critical · IOException
Incompatible blockpoolIDs in {}: namenode blockpoolID = {};
Error message
Incompatible blockpoolIDs in {}: namenode blockpoolID = {}; datanode blockpoolID = {} What it means
Companion check to the namespaceID guard: the blockpoolID persisted in the DN's block pool storage differs from the one the NameNode announces during registration. The DN refuses to attach foreign block pool data to this namespace.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceStorage.java:399
!sd.getPreviousDir().exists()) {
// Restore all the files in the trash. The restored files are retained
// during rolling upgrade rollback. They are deleted during rolling
// upgrade downgrade.
int restored = restoreBlockFilesFromTrash(getTrashRootDir(sd));
LOG.info("Restored {} block files from trash.", restored);
}
readProperties(sd);
checkVersionUpgradable(this.layoutVersion);
assert this.layoutVersion >= DataNodeLayoutVersion.getCurrentLayoutVersion()
: "Future version is not allowed";
if (getNamespaceID() != nsInfo.getNamespaceID()) {
throw new IOException("Incompatible namespaceIDs in "
+ sd.getRoot().getCanonicalPath() + ": namenode namespaceID = "
+ nsInfo.getNamespaceID() + "; datanode namespaceID = "
+ getNamespaceID());
}
if (!blockpoolID.equals(nsInfo.getBlockPoolID())) {
throw new IOException("Incompatible blockpoolIDs in "
+ sd.getRoot().getCanonicalPath() + ": namenode blockpoolID = "
+ nsInfo.getBlockPoolID() + "; datanode blockpoolID = "
+ blockpoolID);
}
if (this.layoutVersion == DataNodeLayoutVersion.getCurrentLayoutVersion()
&& this.cTime == nsInfo.getCTime()) {
return false; // regular startup
}
if (this.layoutVersion > DataNodeLayoutVersion.getCurrentLayoutVersion()) {
int restored = restoreBlockFilesFromTrash(getTrashRootDir(sd));
LOG.info("Restored {} block files from trash " +
"before the layout upgrade. These blocks will be moved to " +
"the previous directory during the upgrade", restored);
}
if (this.layoutVersion > DataNodeLayoutVersion.getCurrentLayoutVersion()
|| this.cTime < nsInfo.getCTime()) {
doUpgrade(sd, nsInfo, callables, conf); // upgrade
return true;View on GitHub (pinned to 2add963021)
Solutions
- Delete the DN's stale BP directories and restart so it formats for the new bpid
- Point the DN at the namespace whose bpid matches its storage, if the data is actually wanted there
- Recreate/re-replicate the data if the old namespace is gone
Defensive patterns
Strategy: validation
Try / catch
catch (IOException e) {
if (e.getMessage().contains("Incompatible blockpoolIDs")) {
haltForOperator("stale BP storage vs current namespace: wipe or repoint");
}
} Prevention
- After any NN format, remove old BP dirs on DNs instead of expecting them to attach
- Do not mix storage from different namespaces on one DataNode
When it happens
Trigger: NN re-formatted (new bpid) while DN retained the old BP dir; DN storage copied from another cluster; registration against the wrong nameservice.
Common situations: Same class as namespaceID mismatch: reformat without DN cleanup, cross-cluster disk reuse, federation misrouting.
Related errors
- Unexpected blockpoolID {}. Expected {}
- Incompatible namespaceIDs in {}: namenode namespaceID = {};
- Incompatible node types: storageType={storageType} but Stora
- Storage directory for location {} and block pool id {} does
- Datanode CTime (={}) is not equal to namenode CTime (={})
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/ec78fc4d0196bfa7.
Report an issue: GitHub.