apache/hadoop · error · UnsupportedOperationException

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

Error message

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

What it means

Error "Replica of type ${getState()} does not support setRecoveryID" thrown in apache/hadoop.

Source

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

        + "\n  bytesAcked=" + bytesAcked
        + "\n  bytesOnDisk=" + bytesOnDisk;
  }

  @Override
  public ReplicaInfo getOriginalReplica() {
    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");
  }

  public void moveReplicaFrom(ReplicaInfo oldReplicaInfo, File newBlkFile)
      throws IOException {

    if (!(oldReplicaInfo instanceof LocalReplica)) {
      throw new IOException("The source replica with blk id "
          + oldReplicaInfo.getBlockId()
          + " should be derived from LocalReplica");
    }

View on GitHub (pinned to 2add963021)

Solutions

  1. Only set a recovery ID on ReplicaUnderRecovery instances; check replica state first.
  2. Route recovery through the standard block recovery workflow rather than mutating ordinary replicas.

When it happens

Trigger: setRecoveryID is invoked on a replica type that does not support recovery IDs.

Common situations: setRecoveryID was called on a replica type that does not track recovery IDs. Internal misuse; use ReplicaUnderRecovery instead.


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