You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "smaheshwar-pltr (via GitHub)" <gi...@apache.org> on 2026/06/15 21:39:02 UTC

[PR] Core: Serialize commits in BaseCommitService [iceberg]

smaheshwar-pltr opened a new pull request, #16825:
URL: https://github.com/apache/iceberg/pull/16825

   ## Core: Serialize commits in `BaseCommitService`
   
   Relates to #9521.
   
   ### Problem
   
   With `partial-progress.enabled=true` and a high `max-concurrent-file-group-rewrites`, rewrites hit many `CommitFailedException` retries on the table. Setting concurrency to `1`, or disabling partial progress, avoids it.
   
   ### Cause
   
   The single-threaded `committerService` exists to serialize table commits, but commits weren't running on it during rewrites. `offer()` called `commitReadyCommitGroups()` directly, so `commitOrClean()` executed on the calling rewrite thread — and the `synchronized` block guarded only batch *selection*, not the commit itself. Many concurrent rewrites therefore committed to the table in parallel and conflicted. (During the active phase the committer thread only committed once `running` was false, so it sat idle.)
   
   This is the same single-committer invariant the Flink sink already enforces, where `FlinkSink` pins `IcebergFilesCommitter` to `.setParallelism(1).setMaxParallelism(1)` — concurrency belongs in the writers, not the committer.
   
   Beyond retries, the conflicts make `succeededCommits()` fall short, inflating the `failedCommits` count in `RewriteDataFilesSparkAction`, which can exceed `partial-progress.max-failed-commits` and fail the whole rewrite.
   
   ### Fix
   
   Commit only on the single committer thread: `offer()` just enqueues, and the committer loop commits ready batches throughout (not just at drain). Commits to the table are now serialized. Batching, partial-progress behavior, internal bookkeeping, and `close()` drain/abort/timeout are unchanged. The public API and the `commitOrClean` / `abortFileGroup` contract are untouched.
   
   ### Testing
   
   Adds `testCommitsAreSerialized`, which asserts `commitOrClean` is never invoked by more than one thread at once. It fails on the pre-fix code (observes up to N concurrent commits) and passes after. Existing `TestCommitService` cases pass unchanged.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Core: Serialize commits in BaseCommitService [iceberg]

Posted by "smaheshwar-pltr (via GitHub)" <gi...@apache.org>.
smaheshwar-pltr closed pull request #16825: Core: Serialize commits in BaseCommitService
URL: https://github.com/apache/iceberg/pull/16825


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Core: Serialize commits in BaseCommitService [iceberg]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #16825:
URL: https://github.com/apache/iceberg/pull/16825#issuecomment-5299400668

   This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Core: Serialize commits in BaseCommitService [iceberg]

Posted by "smaheshwar-pltr (via GitHub)" <gi...@apache.org>.
smaheshwar-pltr commented on PR #16825:
URL: https://github.com/apache/iceberg/pull/16825#issuecomment-5309271531

   Not stale


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org