{"record":{"id":"d56355cd0186a117","repo":"apache/iceberg","slug":"deleted-only-of-file-s-d56355","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.0/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.0/spark/src/main/java/org/apache/iceberg/spark/source/SparkCleanupUtil.java#L97-L121","documentation":"After SparkCleanupUtil.deleteFiles finishes, it compares the successfully deleted count against the requested path count. If some deletions failed (each logged individually), it warns that only a portion of the files were removed. Table data integrity is unaffected — these are uncommitted/abort-time files — but storage may accumulate leftovers.","triggerScenarios":"One or more delete calls in the parallel Tasks.foreach failed (or IOException escaped io.deleteFile for some paths), so deletedFilesCount < paths.size() after retries.","commonSituations":"Partial object-store throttling during large abort cleanups; permission changes mid-job; expired sessions on a subset of workers.","solutions":["Inspect per-file warnings emitted earlier for the failed paths.","Run remove_orphan_files later to sweep leftover files.","Fix underlying storage issues (quota, credentials, throttling) before rerunning workloads that abort frequently."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Schedule periodic remove_orphan_files to reclaim partially-deleted files.","Watch for recurring partial deletions — usually throttling or permission drift.","Ensure bucket quotas/limits accommodate parallel delete bursts."],"tags":["fileio","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-23T08:17:48.524Z"}