apache/iceberg · warning

Deleted only {} of {} file(s) ({})

Error message

Deleted only {} of {} file(s) ({})

What it means

A WARN logged by SparkCleanupUtil.deleteFiles when fewer files were deleted than requested. Individual per-path failures are already logged at a lower level; this summary tells you the abort cleanup was partial, so some written files were not deleted and are now orphaned.

Source

Thrown at spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/source/SparkCleanupUtil.java:115

    Tasks.foreach(paths)
        .executeWith(ThreadPools.getWorkerPool())
        .stopRetryOn(NotFoundException.class)
        .suppressFailureWhenFinished()
        .onFailure((path, exc) -> LOG.warn("Failed to delete {} ({})", path, context, exc))
        .retry(DELETE_NUM_RETRIES)
        .exponentialBackoff(
            DELETE_MIN_RETRY_WAIT_MS,
            DELETE_MAX_RETRY_WAIT_MS,
            DELETE_TOTAL_RETRY_TIME_MS,
            2 /* exponential */)
        .run(
            path -> {
              io.deleteFile(path);
              deletedFilesCount.incrementAndGet();
            });

    if (deletedFilesCount.get() < paths.size()) {
      LOG.warn("Deleted only {} of {} file(s) ({})", deletedFilesCount, paths.size(), context);
    } else {
      LOG.info("Deleted {} file(s) ({})", paths.size(), context);
    }
  }
}

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Inspect earlier 'Failed to delete' warnings to identify which paths failed and why
  2. Re-run orphan-file cleanup to reclaim leaked files
  3. Fix the underlying IO/permission issue before retrying the job
Defensive patterns

Strategy: fallback

Prevention

When it happens

Trigger: After Tasks.foreach completes with some failing deletes, deletedFilesCount.get() < paths.size() — i.e. one or more paths exhausted retries with non-NotFoundException errors.

Common situations: Large aborts across many files where at least one delete hits an object-store error, permission problem, or network failure.

Related errors


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