{"record":{"id":"3162443adbd921f9","repo":"apache/iceberg","slug":"failed-to-delete-uncommitted-dv-for-table-ta","errorCode":null,"errorMessage":"Failed to delete uncommitted DV {} for table {} task {}","messagePattern":"Failed to delete uncommitted DV (.+?) for table (.+?) task (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/EqualityConvertCommitter.java","lineNumber":281,"sourceCode":"    return removedEqDeleteNumCounter.getCount();\n  }\n\n  /**\n   * Deletes the DVs this cycle wrote but did not commit (abort or definite commit failure). Only\n   * the newly written DVs are removed; rewritten DVs remain referenced on the target branch. Best\n   * effort: a delete failure is logged, not propagated, so it never masks the original error.\n   */\n  private void deleteUncommittedDVs() {\n    for (DVWriteResult result : bufferedResults) {\n      if (result.isAbort()) {\n        continue;\n      }\n\n      for (DeleteFile dvFile : result.dvFiles()) {\n        try {\n          table.io().deleteFile(dvFile.location());\n        } catch (RuntimeException e) {\n          LOG.warn(\n              \"Failed to delete uncommitted DV {} for table {} task {}\",\n              dvFile.location(),\n              tableName,\n              taskName,\n              e);\n        }\n      }\n    }\n  }\n\n  private RowDelta buildRowDelta(\n      List<DataFile> dataFiles, List<DeleteFile> allDvFiles, List<DeleteFile> allRewrittenDvFiles) {\n    RowDelta rowDelta = table.newRowDelta();\n\n    // Fail the commit on external target-branch activity since the planner's snapshot. The next\n    // trigger detects the change and reindexes.\n    if (planResult.mainSnapshotId() != null) {\n      rowDelta.validateFromSnapshot(planResult.mainSnapshotId());","sourceCodeStart":263,"sourceCodeEnd":299,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/EqualityConvertCommitter.java#L263-L299","documentation":"A WARN log emitted when deleting an uncommitted deletion vector (DV) file fails during table recovery/commit cleanup. These DV files were staged by a task but never committed; failing to delete them leaks orphan objects in storage. The failure is logged with the DV location, table, and task name, and cleanup continues with the remaining files.","triggerScenarios":"deleteUncommittedDVs(), called from commitIfNeeded when the task commits and rolls back uncommitted DeleteFile DV files: table.io().deleteFile(dvFile.location()) throws a RuntimeException (any I/O or object-store error).","commonSituations":"Object store transient errors or throttling during delete; missing delete permission on the DV path; concurrent cleanup already removed the file; wrong credentials/region configured for the catalog's FileIO.","solutions":["Verify the FileIO credentials/permissions allow DELETE on the DV file locations.","Rerun the maintenance task or run orphan-file cleanup (DELETE ORPHAN FILES with an appropriate older-than interval) to remove the leaked DV file.","Check object-store health/throttling logs for the failed request and retry during a lower-load window.","Confirm no concurrent maintenance job is deleting the same files, which can cause benign conflicts."],"exampleFix":"// before: single-shot delete, leak on failure\ntable.io().deleteFile(dvFile.location());\n// after: retry then tolerate, deferring to orphan cleanup\ntry {\n  table.io().deleteFile(dvFile.location());\n} catch (RuntimeException e) {\n  LOG.warn(\"Deferred deletion of {} to orphan-file cleanup\", dvFile.location(), e);\n}","handlingStrategy":"fallback","validationCode":"// confirm the DV file still exists and is older than the safe interval before deleting\nif (table.io() instanceof FileSystemActingFileIO) {\n  // skip files newer than the orphan-safe window to avoid racing active writers\n  long ageMs = System.currentTimeMillis() - dvFile.modificationTime();\n  Preconditions.checkState(ageMs > orphanSafeIntervalMs, \"DV %s too recent to clean\", dvFile.location());\n}","typeGuard":"boolean deletable(DeleteFile dv) { return dv != null && dv.location() != null && !committedSnapshotsContain(dv.location()); }","tryCatchPattern":"try {\n  table.io().deleteFile(dvFile.location());\n} catch (RuntimeException e) {\n  LOG.warn(\"Deferring DV {} to orphan-file cleanup\", dvFile.location(), e);\n}","preventionTips":["Schedule periodic DELETE ORPHAN FILES to reclaim DV files the rollback could not delete.","Grant the maintenance principal delete permission on the table's DV/orphan paths.","Watch object-store error logs (throttling, permissions) around maintenance windows."],"tags":["flink","deletion-vector","file-deletion","orphan-files","object-store"],"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"}