apache/iceberg · warning

Failed to delete uncommitted DV {} for table {} task {}

Error message

Failed to delete uncommitted DV {} for table {} task {}

What it means

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.

Source

Thrown at flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/EqualityConvertCommitter.java:281

    return removedEqDeleteNumCounter.getCount();
  }

  /**
   * Deletes the DVs this cycle wrote but did not commit (abort or definite commit failure). Only
   * the newly written DVs are removed; rewritten DVs remain referenced on the target branch. Best
   * effort: a delete failure is logged, not propagated, so it never masks the original error.
   */
  private void deleteUncommittedDVs() {
    for (DVWriteResult result : bufferedResults) {
      if (result.isAbort()) {
        continue;
      }

      for (DeleteFile dvFile : result.dvFiles()) {
        try {
          table.io().deleteFile(dvFile.location());
        } catch (RuntimeException e) {
          LOG.warn(
              "Failed to delete uncommitted DV {} for table {} task {}",
              dvFile.location(),
              tableName,
              taskName,
              e);
        }
      }
    }
  }

  private RowDelta buildRowDelta(
      List<DataFile> dataFiles, List<DeleteFile> allDvFiles, List<DeleteFile> allRewrittenDvFiles) {
    RowDelta rowDelta = table.newRowDelta();

    // Fail the commit on external target-branch activity since the planner's snapshot. The next
    // trigger detects the change and reindexes.
    if (planResult.mainSnapshotId() != null) {
      rowDelta.validateFromSnapshot(planResult.mainSnapshotId());

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Verify the FileIO credentials/permissions allow DELETE on the DV file locations.
  2. Rerun the maintenance task or run orphan-file cleanup (DELETE ORPHAN FILES with an appropriate older-than interval) to remove the leaked DV file.
  3. Check object-store health/throttling logs for the failed request and retry during a lower-load window.
  4. Confirm no concurrent maintenance job is deleting the same files, which can cause benign conflicts.

Example fix

// before: single-shot delete, leak on failure
table.io().deleteFile(dvFile.location());
// after: retry then tolerate, deferring to orphan cleanup
try {
  table.io().deleteFile(dvFile.location());
} catch (RuntimeException e) {
  LOG.warn("Deferred deletion of {} to orphan-file cleanup", dvFile.location(), e);
}
Defensive patterns

Strategy: fallback

Validate before calling

// confirm the DV file still exists and is older than the safe interval before deleting
if (table.io() instanceof FileSystemActingFileIO) {
  // skip files newer than the orphan-safe window to avoid racing active writers
  long ageMs = System.currentTimeMillis() - dvFile.modificationTime();
  Preconditions.checkState(ageMs > orphanSafeIntervalMs, "DV %s too recent to clean", dvFile.location());
}

Type guard

boolean deletable(DeleteFile dv) { return dv != null && dv.location() != null && !committedSnapshotsContain(dv.location()); }

Try / catch

try {
  table.io().deleteFile(dvFile.location());
} catch (RuntimeException e) {
  LOG.warn("Deferring DV {} to orphan-file cleanup", dvFile.location(), e);
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Understand the failure class

Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/3162443adbd921f9. Report an issue: GitHub.