apache/hadoop · error · UnsupportedOperationException
Replica of type {} does not support createInfo
Error message
Replica of type {} does not support createInfo What it means
ReplicaWaitingToBeRecovered.createInfo() throws UnsupportedOperationException: createInfo() builds a ReplicaRecoveryInfo (state, id, generation stamp for the recovery handshake) and only replicas actively under recovery can produce one. An RWR replica must be promoted to RUR (wrapped in ReplicaUnderRecovery) before the recovery protocol can ask it for info.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/ReplicaWaitingToBeRecovered.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 getRecoveryID");
}
@Override
public ReplicaRecoveryInfo createInfo() {
throw new UnsupportedOperationException("Replica of type " + getState() +
" does not support createInfo");
}
}
View on GitHub (pinned to 2add963021)
Solutions
- Wrap the replica first: new ReplicaUnderRecovery(rwrReplica, recoveryId).createInfo()
- Ensure initBlockRecovery() path is used - it performs the wrapping for you
- Guard calls with a state check for ReplicaState.RUR before createInfo()
Example fix
// before
ReplicaRecoveryInfo info = replica.createInfo(); // throws for RWR
// after
ReplicaRecoveryInfo info = (replica.getState() == ReplicaState.RUR)
? replica.createInfo()
: new ReplicaUnderRecovery(replica, recoveryId).createInfo(); Defensive patterns
Strategy: type-guard
Validate before calling
import org.apache.hadoop.hdfs.server.protocol.ReplicaState;
if (replica.getState() != ReplicaState.RUR) {
replica = new ReplicaUnderRecovery(replica, recoveryId);
}
ReplicaRecoveryInfo info = replica.createInfo(); Type guard
static boolean canCreateInfo(ReplicaInfo r) {
return r instanceof ReplicaUnderRecovery;
} Try / catch
try { info = r.createInfo(); } catch (UnsupportedOperationException e) { info = new ReplicaUnderRecovery(r, recoveryId).createInfo(); } Prevention
- Use DataNode.initBlockRecovery() rather than hand-rolling the wrap-then-createInfo sequence
- Gate createInfo() calls on RUR state in any generic replica iteration
When it happens
Trigger: Calling createInfo() on a ReplicaWaitingToBeRecovered instance - e.g., during initBlockRecovery the code iterates replicas and calls createInfo() to build ReplicaRecoveryInfo for the NameNode, hitting an RWR entry without converting it first.
Common situations: Custom or test recovery flows that skip the ReplicaUnderRecovery wrapping step; downstream forks where block recovery was refactored and the RWR promotion was lost.
Related errors
- Replica of type {} does not support getOriginalReplica
- Replica of type {} does not support getRecoveryID
- Replica of type ${getState()} does not support getOriginalRe
- Replica of type ${getState()} does not support getOriginalRe
- Replica of type ${getState()} does not support getRecoveryID
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/6338ba79a38dceda.
Report an issue: GitHub.