{"record":{"id":"e3ff5bdaab7c61b4","repo":"apache/iceberg","slug":"deleted-only-of-file-s-e3ff5b","errorCode":null,"errorMessage":"Deleted only {} of {} file(s) ({})","messagePattern":"Deleted only (.+?) of (.+?) file\\(s\\) \\((.+?)\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/source/SparkCleanupUtil.java","lineNumber":115,"sourceCode":"    Tasks.foreach(paths)\n        .executeWith(ThreadPools.getWorkerPool())\n        .stopRetryOn(NotFoundException.class)\n        .suppressFailureWhenFinished()\n        .onFailure((path, exc) -> LOG.warn(\"Failed to delete {} ({})\", path, context, exc))\n        .retry(DELETE_NUM_RETRIES)\n        .exponentialBackoff(\n            DELETE_MIN_RETRY_WAIT_MS,\n            DELETE_MAX_RETRY_WAIT_MS,\n            DELETE_TOTAL_RETRY_TIME_MS,\n            2 /* exponential */)\n        .run(\n            path -> {\n              io.deleteFile(path);\n              deletedFilesCount.incrementAndGet();\n            });\n\n    if (deletedFilesCount.get() < paths.size()) {\n      LOG.warn(\"Deleted only {} of {} file(s) ({})\", deletedFilesCount, paths.size(), context);\n    } else {\n      LOG.info(\"Deleted {} file(s) ({})\", paths.size(), context);\n    }\n  }\n}\n","sourceCodeStart":97,"sourceCodeEnd":121,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/source/SparkCleanupUtil.java#L97-L121","documentation":"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.","triggerScenarios":"After Tasks.foreach completes with some failing deletes, deletedFilesCount.get() < paths.size() — i.e. one or more paths exhausted retries with non-NotFoundException errors.","commonSituations":"Large aborts across many files where at least one delete hits an object-store error, permission problem, or network failure.","solutions":["Inspect earlier 'Failed to delete' warnings to identify which paths failed and why","Re-run orphan-file cleanup to reclaim leaked files","Fix the underlying IO/permission issue before retrying the job"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run removeOrphanFiles on a schedule to reclaim partially deleted files","Fix root-cause IO errors surfaced by the per-path 'Failed to delete' warnings"],"tags":["spark","file-deletion","cleanup"],"backgroundTag":"file-delete-failed","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}