Skip to content

Core: Use transaction metadata for post-commit file cleanup - #17708

Merged
findepi merged 1 commit into
apache:mainfrom
raunaqmorarka:transaction-post-commit-cleanup
Aug 21, 2026
Merged

Core: Use transaction metadata for post-commit file cleanup#17708
findepi merged 1 commit into
apache:mainfrom
raunaqmorarka:transaction-post-commit-cleanup

Conversation

@raunaqmorarka

Copy link
Copy Markdown
Contributor

BaseTransaction resolves its newly committed snapshots through ops.current(), a catalog re-read that can return stale metadata when the catalog caches table pointers. When any new snapshot is missing from the stale view, committedFiles returns null and clean-up of all uncommitted files is skipped ("Failed to load metadata for a committed snapshot, skipping clean-up"). With concurrent writers on a Glue catalog this fired on every commit and leaked one stale manifest list per commit retry attempt.

The transaction's own committed metadata always contains the new snapshots, so resolve them there.

The new test serves stale metadata from current() after a successful commit with injected retries. Without the fix it fails because no uncommitted files are ever deleted.

@github-actions github-actions Bot added the core label Aug 18, 2026
@uros-b

uros-b commented Aug 19, 2026

Copy link
Copy Markdown
Member

+1, LGTM

Comment thread core/src/main/java/org/apache/iceberg/BaseTransaction.java Outdated
Comment thread core/src/main/java/org/apache/iceberg/BaseTransaction.java Outdated
BaseTransaction resolved its newly committed snapshots through
ops.current(), a catalog re-read that can be stale when the catalog
caches table pointers. A missing snapshot made committedFiles return
null, skipping clean-up of all uncommitted files and leaking one stale
manifest list per commit retry attempt. The transaction's own committed
metadata always contains the new snapshots, so resolve them there.
@raunaqmorarka
raunaqmorarka force-pushed the transaction-post-commit-cleanup branch from 27b96e1 to a5fb265 Compare August 20, 2026 12:29
@raunaqmorarka
raunaqmorarka requested a review from findepi August 20, 2026 12:31
@findepi
findepi merged commit 900e882 into apache:main Aug 21, 2026
37 checks passed
@raunaqmorarka
raunaqmorarka deleted the transaction-post-commit-cleanup branch August 21, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants