apache/iceberg · warning

Deleted only {} of {} files from table {} using bulk deletes

Error message

Deleted only {} of {} files from table {} using bulk deletes

What it means

DeleteFilesProcessor.deleteFiles logs this warning when a bulk delete partially fails: a BulkDeletionFailureException reports how many objects failed, and the processor computes how many of the queued files were actually deleted. Failed files remain undeleted and the counters are updated accordingly.

Source

Thrown at flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/DeleteFilesProcessor.java:111

  public void processWatermark(Watermark mark) {
    deleteFiles();
  }

  @Override
  public void prepareSnapshotPreBarrier(long checkpointId) {
    deleteFiles();
  }

  private void deleteFiles() {
    try {
      io.deleteFiles(filesToDelete);
      LOG.info(
          "Deleted {} files from table {} using bulk deletes", filesToDelete.size(), tableName);
      succeededCounter.inc(filesToDelete.size());
      filesToDelete.clear();
    } catch (BulkDeletionFailureException e) {
      int deletedFilesCount = filesToDelete.size() - e.numberFailedObjects();
      LOG.warn(
          "Deleted only {} of {} files from table {} using bulk deletes",
          deletedFilesCount,
          filesToDelete.size(),
          tableName,
          e);
      succeededCounter.inc(deletedFilesCount);
      failedCounter.inc(e.numberFailedObjects());
    }
  }
}

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Check the attached BulkDeletionFailureException for which objects failed and why
  2. Retry the maintenance run — undeleted orphan files can be removed by expire/orphan-file cleanup
  3. Verify FileIO credentials and permissions cover all affected prefixes
  4. Reduce batch size to avoid storage-side throttling during bulk deletes
Defensive patterns

Strategy: retry

Validate before calling

// check FileIO permissions on target prefixes before deleting
fileIO.listPrefix(prefix);

Try / catch

try {
  fileIO.deleteAll(files);
} catch (BulkDeletionFailureException e) {
  int deleted = total - e.numberFailedObjects();
  // retry failed files or schedule orphan cleanup
}

Prevention

When it happens

Trigger: Calling deleteAllWithRePrefix/bulk delete on the FileIO for accumulated filesToDelete throws BulkDeletionFailureException with numberFailedObjects() > 0 — some objects could not be removed from object storage.

Common situations: S3/GCS/OSS transient errors or throttling during bulk delete; objects already removed concurrently; permission issues on some prefixes; expired credentials mid-batch.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/d2faf939d13c7835. Report an issue: GitHub.