apache/hadoop · error · java.io.IOException

Failed update mount table " + mount + " with readonly=" + re

Error message

Failed update mount table " + mount + " with readonly=" + readOnly

What it means

setMountReadOnly() in the FedBalance procedure submitted an UpdateMountTableEntryRequest with the readonly flag set, but the router's MountTableManager.updateMountTableEntry() returned a failure status, so the procedure throws IOException('Failed update mount table <mount> with readonly=<readOnly>') and the balance job aborts. This is the state-store-side rejection of the readonly toggle, not a missing entry.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/rbfbalance/MountTableProcedure.java:202

      Configuration conf) throws IOException {
    String address = conf.getTrimmed(RBFConfigKeys.DFS_ROUTER_ADMIN_ADDRESS_KEY,
        RBFConfigKeys.DFS_ROUTER_ADMIN_ADDRESS_DEFAULT);
    InetSocketAddress routerSocket = NetUtils.createSocketAddr(address);
    RouterClient rClient = new RouterClient(routerSocket, conf);
    try {
      MountTableManager mountTable = rClient.getMountTableManager();

      MountTable originalEntry = getMountEntry(mount, mountTable);
      if (originalEntry == null) {
        throw new IOException("Mount table " + mount + " doesn't exist");
      } else {
        originalEntry.setReadOnly(readOnly);
        UpdateMountTableEntryRequest updateRequest =
            UpdateMountTableEntryRequest.newInstance(originalEntry);
        UpdateMountTableEntryResponse response =
            mountTable.updateMountTableEntry(updateRequest);
        if (!response.getStatus()) {
          throw new IOException(
              "Failed update mount table " + mount + " with readonly="
                  + readOnly);
        }
        rClient.getMountTableManager().refreshMountTableEntries(
            RefreshMountTableEntriesRequest.newInstance());
      }
    } finally {
      rClient.close();
    }
  }

  @Override
  public void write(DataOutput out) throws IOException {
    super.write(out);
    Text.writeString(out, mount);
    Text.writeString(out, dstPath);
    Text.writeString(out, dstNs);
    conf.write(out);

View on GitHub (pinned to 2add963021)

Solutions

  1. Inspect router and state store logs for the update failure cause
  2. Re-check the mount's current readonly state: hdfs dfsrouteradmin -list
  3. After state store recovery, retry the fedbalance job (the switch phase is re-entrant)
  4. Prevent concurrent admin edits to the mount during balance operations
Defensive patterns

Strategy: retry

Try / catch

// Retry the readonly toggle after transient state store failures
boolean done = false;
for (int attempt = 1; attempt <= 3 && !done; attempt++) {
  try {
    MountTableProcedure.setMountReadOnly(mount, true, conf);
    done = true;
  } catch (IOException e) {
    LOG.warn("readonly toggle attempt {} failed: {}", attempt, e.getMessage());
    if (attempt == 3) throw e;
    TimeUnit.SECONDS.sleep(5L);
  }
}

Prevention

When it happens

Trigger: The update RPC returns status=false: state store write failure (ZooKeeper/DB unreachable or session expired), concurrent modification of the same mount entry, or router-internal error while persisting the readonly change.

Common situations: Transient state store outage during the switch phase; concurrent dfsrouteradmin -update on the same mount; router under restart while the balance toggles readonly.

Related errors


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