{"record":{"id":"b0a4e139f3521093","repo":"apache/iceberg","slug":"deleted-only-of-file-s","errorCode":null,"errorMessage":"Deleted only {} of {} file(s) ({})","messagePattern":"Deleted only (.+?) of (.+?) file\\(s\\) \\((.+?)\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"spark/v3.5/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/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/SparkCleanupUtil.java#L97-L121","documentation":"After the retried bulk delete in SparkCleanupUtil, the count of successfully deleted files is compared to the requested paths; if some failed (their failures were suppressed), this warning reports how many were actually deleted. The streaming job continues; failed files remain on storage.","triggerScenarios":"delete() completes with Tasks suppressing per-file failures, so at least one path's io.deleteFile failed after all retries.","commonSituations":"Intermittent cloud storage errors during high delete volume, or files concurrently removed by another process (expiration/orphan cleanup running simultaneously).","solutions":["Cross-check remaining files against the cleanup context and delete manually if safe","Avoid running expire_snapshots/remove_orphan_files concurrently with streaming cleanup on the same table","Investigate per-file failures from the earlier 'Failed to delete' warnings"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// after cleanup: list leftover paths and compare against the failed set","typeGuard":null,"tryCatchPattern":"long failed = totalPaths - deletedCount; if (failed > 0) { /* re-run delete or inspect 'Failed to delete' warnings */ }","preventionTips":["Re-run cleanup or manual deletion after partial failures","Don't run expire_snapshots/remove_orphan_files concurrently with streaming cleanup","Monitor the paired 'Failed to delete' warnings for root causes"],"tags":["spark","file-delete","cleanup","partial-failure"],"backgroundTag":"file-write-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"}