apache/hadoop · error · UnsupportedOperationException
ProvidedReplica does not yet support copy data
Error message
ProvidedReplica does not yet support copy data
What it means
copyBlockdata(URI destination) streams a replica's block bytes to a destination URI during FsDatasetImpl.copyBlock (replication target). ProvidedReplica throws UnsupportedOperationException because receiving and storing incoming block bytes into the external provided store is not supported - provided volumes only expose pre-existing aliased data.
Source
Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/ProvidedReplica.java:342
throw new UnsupportedOperationException(
"ProvidedReplica does not yet support truncate");
}
@Override
public void updateWithReplica(StorageLocation replicaLocation) {
throw new UnsupportedOperationException(
"ProvidedReplica does not yet support update");
}
@Override
public void copyMetadata(URI destination) throws IOException {
throw new UnsupportedOperationException(
"ProvidedReplica does not yet support copy metadata");
}
@Override
public void copyBlockdata(URI destination) throws IOException {
throw new UnsupportedOperationException(
"ProvidedReplica does not yet support copy data");
}
@VisibleForTesting
public void setPathHandle(PathHandle pathHandle) {
this.pathHandle = pathHandle;
}
}
View on GitHub (pinned to 2add963021)
Solutions
- Keep PROVIDED volumes out of write/replication volume selection (they are read-only serving tiers).
- Pre-check the target volume/replica type before copyBlockdata and fail fast with a descriptive error.
- Clean up any partially created ProvidedReplica in a finally/catch so the block map stays consistent.
- Catch UnsupportedOperationException at the copy boundary, roll back the replica registration, and report to the NameNode.
Example fix
// before
replica.copyBlockdata(destUri);
// after
if (replica instanceof ProvidedReplica) {
throw new IOException("PROVIDED volume cannot receive block copies");
}
replica.copyBlockdata(destUri); Defensive patterns
Strategy: validation
Validate before calling
if (replica instanceof ProvidedReplica) {
throw new IOException("PROVIDED volume cannot receive block copies");
}
replica.copyBlockdata(destUri); Type guard
static boolean isProvided(ReplicaInfo r) {
return r instanceof ProvidedReplica;
} Try / catch
try {
replica.copyBlockdata(destUri);
} catch (UnsupportedOperationException e) {
dataset.invalidate(bpid, replica.getBlock());
throw new IOException("PROVIDED volume cannot receive block data", e);
} Prevention
- Restrict replica placement to local writable volumes.
- Treat provided volumes as serving-only tiers in placement logic.
- Clean up partial state when a copy into a provided replica fails.
When it happens
Trigger: A replication or copy operation attempts to write incoming block bytes through a FinalizedProvidedReplica: copyBlockdata(destination) is invoked on a ProvidedReplica created on a PROVIDED volume.
Common situations: Mixed local+PROVIDED data dirs where the volume chooser or a test places new replicas on the provided volume; or custom FsDataset code that assumes every replica can receive a copy.
Related errors
- ProvidedReplica does not support deleting metadata
- ProvidedReplica does not support renaming metadata
- ProvidedReplica does not support renaming data
- ProvidedReplica does not support pinning
- ProvidedReplica does not yet support truncate
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/1a9467e6acd943d0.
Report an issue: GitHub.