{"record":{"id":"402b664428f6608d","repo":"apache/hadoop","slug":"the-source-replica-with-blk-id-oldreplicainfo-ge","errorCode":null,"errorMessage":"The source replica with blk id ${oldReplicaInfo.getBlockId()} should be derived from LocalReplica","messagePattern":"The source replica with blk id (.+?) should be derived from LocalReplica","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/LocalReplicaInPipeline.java","lineNumber":417,"sourceCode":"  }\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\n    if (!(oldReplicaInfo instanceof LocalReplica)) {\n      throw new IOException(\"The source replica with blk id \"\n          + oldReplicaInfo.getBlockId()\n          + \" should be derived from LocalReplica\");\n    }\n\n    final LocalReplica oldReplica = (LocalReplica) oldReplicaInfo;\n    final File oldBlockFile = oldReplica.getBlockFile();\n    final File oldmeta = oldReplica.getMetaFile();\n    final File newmeta = getMetaFile();\n    final FileIoProvider fileIoProvider = getFileIoProvider();\n\n    try {\n      fileIoProvider.rename(getVolume(), oldmeta, newmeta);\n    } catch (IOException e) {\n      throw new IOException(\"Block \" + oldReplicaInfo + \" reopen failed. \" +\n                            \" Unable to move meta file  \" + oldmeta +\n                            \" to rbw dir \" + newmeta, e);\n    }\n","sourceCodeStart":399,"sourceCodeEnd":435,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/LocalReplicaInPipeline.java#L399-L435","documentation":"Error \"The source replica with blk id ${oldReplicaInfo.getBlockId()} should be derived from LocalReplica\" thrown in apache/hadoop.","triggerScenarios":"Constructing a LocalReplicaInPipeline from a source replica that is not derived from LocalReplica (e.g., a ProvidedReplica).","commonSituations":"A pipeline replica was built from a source that is not a LocalReplica, an internal invariant violation. Indicates mixed provided/local replica usage.","solutions":["Ensure the replica passed to the pipeline builder is a LocalReplica-derived instance (RBW/finalized local replica), not a provided or remote replica.","Check that the block id belongs to local storage before constructing a LocalReplicaInPipeline."],"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"}