apache/hadoop · error · ReconfigurationException

Enabling or disabling storage policy satisfier service on {s

Error message

Enabling or disabling storage policy satisfier service on {state} NameNode is not allowed

What it means

After validating the mode string, reconfigureSPSModeEvent requires the NameNode to be in active state: if !isActiveState() it throws ReconfigurationException wrapping HadoopIllegalArgumentException, embedding this node's current state variable (e.g. 'standby') in the message. The StoragePolicySatisfier service runs only on the active NameNode, so its mode cannot be changed on a standby or observer node.

Source

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

      return result;
    } catch (IllegalArgumentException e) {
      throw new ReconfigurationException(property, newVal, getConf().get(property), e);
    }
  }

  String reconfigureSPSModeEvent(String newVal, String property)
      throws ReconfigurationException {
    if (newVal == null
        || StoragePolicySatisfierMode.fromString(newVal) == null) {
      throw new ReconfigurationException(property, newVal,
          getConf().get(property),
          new HadoopIllegalArgumentException(
              "For enabling or disabling storage policy satisfier, must "
                  + "pass either internal/external/none string value only"));
    }

    if (!isActiveState()) {
      throw new ReconfigurationException(property, newVal,
          getConf().get(property),
          new HadoopIllegalArgumentException(
              "Enabling or disabling storage policy satisfier service on "
                  + state + " NameNode is not allowed"));
    }
    StoragePolicySatisfierMode mode = StoragePolicySatisfierMode
        .fromString(newVal);
    if (mode == StoragePolicySatisfierMode.NONE) {
      // disabling sps service
      if (namesystem.getBlockManager().getSPSManager() != null) {
        namesystem.getBlockManager().getSPSManager().changeModeEvent(mode);
        namesystem.getBlockManager().disableSPS();
      }
    } else {
      // enabling sps service
      boolean spsCreated = (namesystem.getBlockManager()
          .getSPSManager() != null);
      if (!spsCreated) {

View on GitHub (pinned to 2add963021)

Solutions

  1. Find the current active (`hdfs haadmin -getAllServiceState` or the NameNode web UI) and send the reconfig to that RPC address
  2. Make automation resolve the active NN at runtime instead of hardcoding one node
  3. If a failover is planned, reconfigure SPS mode on the new active after the failover completes
  4. Verify with `hdfs haadmin -getServiceState <nnId>` right before the call

Example fix

# before - targeting a standby NameNode
hdfs dfsadmin -reconfig namenode nn2:8020 -set dfs.storage.policy.satisfier.mode=external

# after - resolve the active NN first, then reconfigure it
ACTIVE=$(hdfs haadmin -getAllServiceState | awk '/active/{print $1}' | head -1)
hdfs dfsadmin -reconfig namenode "${ACTIVE}" -set dfs.storage.policy.satisfier.mode=external
Defensive patterns

Strategy: validation

Validate before calling

# Resolve the ACTIVE NameNode before reconfiguring SPS mode
ACTIVE=$(hdfs haadmin -getAllServiceState | awk '/active/{print $1}' | head -1)
[ -n "$ACTIVE" ] || { echo "no active NN found"; exit 1; }
hdfs dfsadmin -reconfig namenode "$ACTIVE" -set dfs.storage.policy.satisfier.mode=external

Type guard

static boolean isActiveTarget(HAServiceProtocol p) throws IOException {
  return p.getServiceState() == HAServiceState.ACTIVE;
}

Try / catch

catch (ReconfigurationException e) {
  if (e.getCause() != null && e.getCause().getMessage().contains("NameNode is not allowed")) {
    // re-resolve active NN and retry the reconfig there
  }
}

Prevention

When it happens

Trigger: `hdfs dfsadmin -reconfig namenode <standbyAddr> -set dfs.storage.policy.satisfier.mode=...` - the reconfig RPC went to a standby/observer NameNode of an HA pair.

Common situations: The operator addressed the standby by habit or from stale documentation; a failover happened between scripting and execution so the previously-active address is now standby; automation hardcoded one node of the HA pair.

Related errors


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