{"record":{"id":"7a0b28804688abe5","repo":"apache/hadoop","slug":"replica-of-type-getstate-does-not-support-get-7a0b28","errorCode":null,"errorMessage":"Replica of type ${getState()} does not support getOriginalReplica","messagePattern":"Replica of type (.+?) does not support getOriginalReplica","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/LocalReplicaInPipeline.java","lineNumber":391,"sourceCode":"    File restartMeta = new File(blockFile.getParent()  +\n        File.pathSeparator + \".\" + blockFile.getName() + \".restart\");\n    if (!getFileIoProvider().deleteWithExistsCheck(getVolume(), restartMeta)) {\n      DataNode.LOG.warn(\"Failed to delete restart meta file: \" +\n          restartMeta.getPath());\n    }\n    return getFileIoProvider().getFileOutputStream(getVolume(), restartMeta);\n  }\n\n  @Override\n  public String toString() {\n    return super.toString()\n        + \"\\n  bytesAcked=\" + bytesAcked\n        + \"\\n  bytesOnDisk=\" + bytesOnDisk;\n  }\n\n  @Override\n  public ReplicaInfo getOriginalReplica() {\n    throw new UnsupportedOperationException(\"Replica of type \" + getState() +\n        \" does not support getOriginalReplica\");\n  }\n\n  @Override\n  public long getRecoveryID() {\n    throw new UnsupportedOperationException(\"Replica of type \" + getState() +\n        \" does not support getRecoveryID\");\n  }\n\n  @Override\n  public void setRecoveryID(long recoveryId) {\n    throw new UnsupportedOperationException(\"Replica of type \" + getState() +\n        \" does not support setRecoveryID\");\n  }\n\n  @Override\n  public ReplicaRecoveryInfo createInfo(){\n    throw new UnsupportedOperationException(\"Replica of type \" + getState() +","sourceCodeStart":373,"sourceCodeEnd":409,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/LocalReplicaInPipeline.java#L373-L409","documentation":"Error \"Replica of type ${getState()} does not support getOriginalReplica\" thrown in apache/hadoop.","triggerScenarios":"Code calls getOriginalReplica on a replica whose state does not support it (e.g., not a ReplicaUnderRecovery).","commonSituations":"Code called getOriginalReplica on a replica type that has no original, an internal misuse. Only valid on ReplicaUnderRecovery.","solutions":["Do not call getOriginalReplica on a replica in this state; only replicas under recovery expose the original replica.","Check the replica state before invoking recovery-only APIs."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}