{"record":{"id":"b30fb5b72414f6d8","repo":"apache/iceberg","slug":"failure-during-rewrite-process-for-group-b30fb5","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/v4.0/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/v4.0/spark/src/main/java/org/apache/iceberg/spark/actions/RewritePositionDeleteFilesSparkAction.java#L192-L228","documentation":"WARN log from RewritePositionDeleteFilesSparkAction.doExecute: a group of position-delete files failed during its rewrite Spark job; the Tasks.foreach onFailure hook logs the group's info and exception. Like the data-file rewrite, failures are surfaced per-group without necessarily failing the whole statement.","triggerScenarios":"Running rewrite_position_delete_files where one group's job throws — compaction of position deletes fails due to OOM, reader errors on corrupt delete files, or write failures.","commonSituations":"Very large position-delete files exhausting executor memory; delete files written by older writers with incompatible layouts; transient storage errors during the rewritten-parquet write.","solutions":["Inspect the Spark executor logs for the underlying task exception.","Rewrite fewer files per group / increase executor memory if OOM.","Verify the failing position-delete file is readable; exclude or repair corrupt files.","Re-run the action; successfully rewritten groups are already committed."],"exampleFix":"null","handlingStrategy":"retry","validationCode":"table.refresh(); // current snapshot includes expected delete files","typeGuard":null,"tryCatchPattern":"try { result = action.execute(); } catch (Exception e) { /* per-group failures are logged; re-run for failed groups */ }","preventionTips":["Size position-delete groups to fit executor memory","Validate delete files readable after writer upgrades","Re-run to complete groups that failed"],"tags":["logging","spark","position-deletes","rewrite"],"backgroundTag":"spark-job-failure","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"}