apache/hadoop · error · UnsupportedOperationException

ProvidedReplica does not yet support update

Error message

ProvidedReplica does not yet support update

What it means

updateWithReplica(StorageLocation) is used by FsDatasetImpl.moveBlockAcrossVolumes to re-point a replica's files at a new storage location after a block move. ProvidedReplica throws UnsupportedOperationException because its FileRegion/URI binding to the remote store cannot be re-targeted to another storage location.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/ProvidedReplica.java:330

  public int compareWith(ScanInfo info) {
    if (info.getFileRegion().equals(
        new FileRegion(this.getBlockId(), new Path(getRemoteURI()),
            fileOffset, this.getNumBytes(), this.getGenerationStamp()))) {
      return 0;
    } else {
      return (int) (info.getBlockLength() - getNumBytes());
    }
  }

  @Override
  public void truncateBlock(long newLength) throws IOException {
    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

  1. Filter PROVIDED volumes out of balancer/diskbalancer plans and volume-choice logic (consult FsVolumeSpi supported operations / ProvidedVolumeImpl).
  2. Never use a provided volume as a move destination; restrict moves to local volumes.
  3. Guard updateWithReplica callers with an instanceof ProvidedReplica check and skip the move.
  4. Catch UnsupportedOperationException during the move loop, log the block as immovable, and continue the plan.

Example fix

// before
replica.updateWithReplica(newLocation);

// after
if (!(replica instanceof ProvidedReplica)) {
  replica.updateWithReplica(newLocation);
} else {
  LOG.warn("Block {} is PROVIDED; skipping move to {}",
      replica.getBlockId(), newLocation);
}
Defensive patterns

Strategy: validation

Validate before calling

if (!(replica instanceof ProvidedReplica)) {
  replica.updateWithReplica(newLocation);
} else {
  LOG.warn("Block {} is PROVIDED; skipping move to {}",
      replica.getBlockId(), newLocation);
}

Type guard

static boolean isProvided(ReplicaInfo r) {
  return r instanceof ProvidedReplica;
}

Try / catch

try {
  replica.updateWithReplica(newLocation);
} catch (UnsupportedOperationException e) {
  LOG.warn("Block {} cannot be moved (provided storage): {}",
      replica.getBlockId(), e.getMessage());
}

Prevention

When it happens

Trigger: Disk balancer or block-mover logic selecting a PROVIDED volume as the destination of a move; the movement code calls updateWithReplica on the (provided) replica to record the new location.

Common situations: Running diskbalancer/balancer plans or DataNode volume-maintenance scripts on a node whose data dirs mix local DISK and PROVIDED volumes; the plan does not account for read-only provided volumes.

Related errors


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/d05a67b4f9b678a4. Report an issue: GitHub.