{"record":{"id":"ab905a748605d938","repo":"apache/hadoop","slug":"replica-of-type-getstate-does-not-support-get-ab905a","errorCode":null,"errorMessage":"Replica of type ${getState()} does not support getRecoveryID","messagePattern":"Replica of type (.+?) does not support getRecoveryID","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":397,"sourceCode":"    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() +\n        \" does not support createInfo\");\n  }\n\n  public void moveReplicaFrom(ReplicaInfo oldReplicaInfo, File newBlkFile)\n      throws IOException {\n","sourceCodeStart":379,"sourceCodeEnd":415,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/LocalReplicaInPipeline.java#L379-L415","documentation":"Error \"Replica of type ${getState()} does not support getRecoveryID\" thrown in apache/hadoop.","triggerScenarios":"getRecoveryID is invoked on a replica type that does not track recovery IDs.","commonSituations":"getRecoveryID was called on a replica type that does not track recovery IDs. Indicates internal misuse; only recovery-state replicas support it.","solutions":["Only call getRecoveryID on replicas under recovery; guard the call with a state check.","Use ReplicaUnderRecovery for recovery operations instead of the base replica object."],"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"}