apache/hadoop · error · UnsupportedOperationException

Replica of type ${getState()} does not support createInfo

Error message

Replica of type ${getState()} does not support createInfo

What it means

createInfo() builds the ReplicaRecoveryInfo exchanged in the block-recovery handshake. For a FinalizedProvidedReplica the DataNode cannot serve recovery from external PROVIDED storage, and there is no local length/generation metadata to report the way local finalized replicas do, so the method throws UnsupportedOperationException.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/FinalizedProvidedReplica.java:119

    throw new UnsupportedOperationException("Replica of type " + getState() +
        " does not support getOriginalReplica");
  }

  @Override
  public long getRecoveryID() {
    throw new UnsupportedOperationException("Replica of type " + getState() +
        " does not support getRecoveryID");
  }

  @Override
  public void setRecoveryID(long recoveryId) {
    throw new UnsupportedOperationException("Replica of type " + getState() +
        " does not support setRecoveryID");
  }

  @Override
  public ReplicaRecoveryInfo createInfo() {
    throw new UnsupportedOperationException("Replica of type " + getState() +
        " does not support createInfo");
  }
}

View on GitHub (pinned to 2add963021)

Solutions

  1. Restrict createInfo() calls to replicas that support recovery (local RBW/RWR/RUR, or finalized local replicas in flows designed for them).
  2. When a block has a provided replica locally, answer recovery from another DataNode's replica.
  3. Upgrade to a HDFS release containing provided-storage guards for the failing flow and verify against its JIRA.
  4. Return a failure the recovery protocol understands instead of letting UnsupportedOperationException escape.

Example fix

// before
ReplicaRecoveryInfo info = replica.createInfo();

// after: type-check before building recovery info
if (replica instanceof ReplicaUnderReconstruction) {
  ReplicaRecoveryInfo info = replica.createInfo();
} else {
  // provided replica: report 'cannot recover locally' to the recovery flow
}
Defensive patterns

Strategy: type-guard

Type guard

static boolean canBuildRecoveryInfo(ReplicaInfo r) {
  return r instanceof ReplicaUnderReconstruction;
}

Try / catch

try {
  ReplicaRecoveryInfo info = replica.createInfo();
} catch (UnsupportedOperationException e) {
  // provided replica cannot serve recovery info locally: answer from another DataNode
}

Prevention

When it happens

Trigger: Block-recovery flow calling createInfo() on a provided replica — e.g., startBlockRecovery gathering info from every replica in the volume map including PROVIDED ones.

Common situations: PROVIDED-storage clusters triggering recovery on blocks whose local presence is provided; generic recovery tooling that calls createInfo() on all replicas regardless of type; framework versions whose recovery path predates provided-storage support.

Related errors


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