{"record":{"id":"778f96cb8d6f2d4e","repo":"apache/iceberg","slug":"failure-during-rewrite-process-for-group-778f96","errorCode":null,"errorMessage":"Failure during rewrite process for group {}","messagePattern":"Failure during rewrite process for group (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/actions/RewritePositionDeleteFilesSparkAction.java","lineNumber":210,"sourceCode":"\n  private Result doExecute(\n      FileRewritePlan<\n              FileGroupInfo, PositionDeletesScanTask, DeleteFile, RewritePositionDeletesGroup>\n          plan,\n      RewritePositionDeletesCommitManager commitManager) {\n    ExecutorService rewriteService = rewriteService();\n\n    ConcurrentLinkedQueue<RewritePositionDeletesGroup> rewrittenGroups =\n        new ConcurrentLinkedQueue<>();\n\n    Tasks.Builder<RewritePositionDeletesGroup> rewriteTaskBuilder =\n        Tasks.foreach(plan.groups())\n            .executeWith(rewriteService)\n            .stopOnFailure()\n            .noRetry()\n            .onFailure(\n                (fileGroup, exception) ->\n                    LOG.warn(\n                        \"Failure during rewrite process for group {}\",\n                        fileGroup.info(),\n                        exception));\n\n    try {\n      rewriteTaskBuilder.run(fileGroup -> rewrittenGroups.add(rewriteDeleteFiles(plan, fileGroup)));\n    } catch (Exception e) {\n      // At least one rewrite group failed, clean up all completed rewrites\n      LOG.error(\n          \"Cannot complete rewrite, {} is not enabled and one of the file set groups failed to \"\n              + \"be rewritten. This error occurred during the writing of new files, not during the commit process. This \"\n              + \"indicates something is wrong that doesn't involve conflicts with other Iceberg operations. Enabling \"\n              + \"{} may help in this case but the root cause should be investigated. Cleaning up {} groups which finished \"\n              + \"being written.\",\n          PARTIAL_PROGRESS_ENABLED,\n          PARTIAL_PROGRESS_ENABLED,\n          rewrittenGroups.size(),\n          e);","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/actions/RewritePositionDeleteFilesSparkAction.java#L192-L228","documentation":"RewritePositionDeleteFilesSparkAction runs per-group rewrite tasks with stopOnFailure/noRetry and an onFailure callback that logs this warning with the group's info and exception. A group whose position-delete rewrite fails is reported here and simply omitted from the rewritten output rather than failing the job.","triggerScenarios":"A file group of position delete files fails during RewritePositionDeleteFiles doExecute — e.g. reader errors on corrupt deletion vectors, writer failures producing rewritten delete files, or executor OOM on large groups.","commonSituations":"Very large accumulated delete files exceeding executor memory; unreadable delete files from older writer versions; transient executor loss on shared clusters.","solutions":["Read the attached exception and the group info (lists the delete files involved) to find the root cause.","Lower the group size threshold (rewrite-all / max file group size options) so each task handles less data.","Re-run the action after transient executor failures — failed groups are untouched and retried on the next run.","If delete files are corrupt, compact or remove the offending entries before re-running the rewrite."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Re-run the action periodically; failed groups are retried next time.","Keep delete-file groups small via size thresholds to avoid executor OOM.","Monitor for corrupt delete files from older writers and compact them.","Use a stable cluster/queue to reduce executor-loss failures."],"tags":["spark","position-deletes","rewrite","task-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-14T21:17:11.552Z"}