apache/hadoop · critical · IOException

Incompatible namespaceIDs: Namenode namespaceID = {}; {} no

Error message

Incompatible namespaceIDs:  Namenode namespaceID = {}; {} node namespaceID = {}

What it means

registerBackupNode rejects a BackupNode whose namespaceID differs from this NameNode's, throwing IOException with both ids. Namespace id is assigned at format time, so a mismatch means the two nodes were initialized against different (or re-formatted) clusters and cannot share journals.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java:6240

    FSDirWriteFileOp.persistBlocks(dir, src, pendingFile, logRetryCache);
  }

  /**
   * Register a Backup name-node, verifying that it belongs
   * to the correct namespace, and adding it to the set of
   * active journals if necessary.
   * 
   * @param bnReg registration of the new BackupNode
   * @param nnReg registration of this NameNode
   * @throws IOException if the namespace IDs do not match
   */
  void registerBackupNode(NamenodeRegistration bnReg,
      NamenodeRegistration nnReg) throws IOException {
    writeLock(RwLockMode.FS);
    try {
      if(getNNStorage().getNamespaceID()
         != bnReg.getNamespaceID())
        throw new IOException("Incompatible namespaceIDs: "
            + " Namenode namespaceID = "
            + getNNStorage().getNamespaceID() + "; "
            + bnReg.getRole() +
            " node namespaceID = " + bnReg.getNamespaceID());
      if (bnReg.getRole() == NamenodeRole.BACKUP) {
        getFSImage().getEditLog().registerBackupNode(
            bnReg, nnReg);
      }
    } finally {
      writeUnlock(RwLockMode.FS, "registerBackupNode");
    }
  }

  /**
   * Release (unregister) backup node.
   * <p>
   * Find and remove the backup stream corresponding to the node.
   * @throws IOException

View on GitHub (pinned to 2add963021)

Solutions

  1. Wipe or re-format the BackupNode's name directories so it re-registers and re-downloads the namespace
  2. Verify namespaceID/clusterID/blockPoolId match across nodes (VERSION files, 'hdfs dfsadmin -report')
  3. Never reuse storage directories across cluster lifecycles; keep a provisioning step that formats both together

Example fix

# before
hdfs --daemon start backupnode  # VERSION file from an old cluster

# after
rm -rf /dfs/backupnode/current   # or point to a fresh dir / format it
hdfs --daemon start backupnode    # re-registers with current namespace
Defensive patterns

Strategy: validation

Validate before calling

// compare VERSION files before starting the BackupNode
Properties nnV = readProps(nnDir + "/current/VERSION");
Properties bnV = readProps(bnDir + "/current/VERSION");
if (bnV.isEmpty() || !nnV.getProperty("namespaceID").equals(bnV.getProperty("namespaceID"))) {
  // wipe bnDir so it re-downloads the namespace
}

Prevention

When it happens

Trigger: Starting a BackupNode with storage directories formatted against another namespace, or after the NameNode was re-formatted while the BackupNode kept its old state.

Common situations: Re-formatting the NameNode without cleaning BackupNode dirs; copying configs across test clusters; reusing data directories from a previous cluster build.

Related errors


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/ad9e1e73d21466c2. Report an issue: GitHub.