Preserve failed batch cleanup tasks for retry - #5421
Open
mattfaltyn wants to merge 2 commits into
Open
Conversation
vigneshio
approved these changes
Sep 3, 2026
Contributor
There was a problem hiding this comment.
Thanks for the contribution @mattfaltyn.. LGTM. Resolve conflicts.
Propagate bulk and individual file deletion errors through the existing batch retry loop instead of suppressing them. Keep partial deletion idempotent and verify persisted tasks remain available for a later retry. Fixes apache#5420
mattfaltyn
force-pushed
the
fix-batch-cleanup-error-propagation
branch
from
September 3, 2026 08:23
ac75de4 to
2c71c63
Compare
Contributor
Author
Thanks @vigneshio! Rebased onto the latest |
flyingImer
approved these changes
Sep 8, 2026
| .run( | ||
| file -> { | ||
| try { | ||
| fileIO.deleteFile(file); |
Collaborator
There was a problem hiding this comment.
IIUC, (non-blocking) this restores retries for failures reported by FileIO, but Azure still has a gap. Iceberg 1.11.0's ADLSFileIO.deleteFile catches RuntimeException and only logs it, so a failed deletion can still look successful and cause Polaris to drop the task. This predates the PR. Could we note the limitation and track the Azure case separately?
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5420.
Batch cleanup currently delegates to Iceberg's best-effort
CatalogUtil.deleteFiles, which suppresses storage deletion errors. Polaris therefore skips its retries, reports success, and drops the persisted task while files remain undeleted.This change propagates bulk deletion errors directly and uses error-propagating per-file deletion for other FileIO implementations. The existing batch loop keeps its three-attempt retry budget and backoff. Sequential/concurrent deletion is preserved, and an already-deleted file remains a successful outcome when retrying a partial batch.
The regression tests inject actual transient and permanent deletion failures instead of overriding retry recursion. They cover bulk and individual deletion, partial deletion in both execution modes, and task persistence/events followed by a successful replay. No public API, configuration, or persistence format changes are needed. Existing task retry/recovery scheduling is unchanged; this does not reconstruct tasks already lost before the fix.
Known limitation: Iceberg 1.11.0's
ADLSFileIO.deleteFilesuppresses runtime deletion failures before Polaris can observe them, so Azure cleanup is not covered by this fix. Tracked separately in #5482.Validation completed on Ubuntu 24.04.4 / Java 21 using stock database images:
./gradlew format compileAll :polaris-runtime-service:checkpassed. The module results contain 24,817 passes, 986 skips, and no failures or errors../gradlew checkpassed: 28,515 passed, 1,011 skipped, and no failures or errors across 29,526 cases. Existing credential guards account for 873 runtime-cloud skips.Checklist
CHANGELOG.md(if needed)site/content/in-dev/unreleased; no changes needed because this restores cleanup retry behavior without changing APIs or configuration.Prepared with significant AI assistance.