apache/hadoop · error · IOException
The source replica with blk id ${oldReplicaInfo.getBlockId()
Error message
The source replica with blk id ${oldReplicaInfo.getBlockId()} should be derived from LocalReplica What it means
Error "The source replica with blk id ${oldReplicaInfo.getBlockId()} should be derived from LocalReplica" thrown in apache/hadoop.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/LocalReplicaInPipeline.java:417
}
@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");
}
final LocalReplica oldReplica = (LocalReplica) oldReplicaInfo;
final File oldBlockFile = oldReplica.getBlockFile();
final File oldmeta = oldReplica.getMetaFile();
final File newmeta = getMetaFile();
final FileIoProvider fileIoProvider = getFileIoProvider();
try {
fileIoProvider.rename(getVolume(), oldmeta, newmeta);
} catch (IOException e) {
throw new IOException("Block " + oldReplicaInfo + " reopen failed. " +
" Unable to move meta file " + oldmeta +
" to rbw dir " + newmeta, e);
}
View on GitHub (pinned to 2add963021)
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.
When it happens
Trigger: Constructing a LocalReplicaInPipeline from a source replica that is not derived from LocalReplica (e.g., a ProvidedReplica).
Common situations: A pipeline replica was built from a source that is not a LocalReplica, an internal invariant violation. Indicates mixed provided/local replica usage.
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/402b664428f6608d.
Report an issue: GitHub.