Core: Expose commit retry exhaustion reason in failure messages#16757
Draft
shangeyao wants to merge 12 commits into
Draft
Core: Expose commit retry exhaustion reason in failure messages#16757shangeyao wants to merge 12 commits into
shangeyao wants to merge 12 commits into
Conversation
…he#16744) When commit retry is exhausted, the failure message now indicates whether the retry attempt limit or the total timeout was reached, helping users know which table property to adjust. - Add RetryExhaustedException with Reason enum in Tasks.java - Translate retry exhaustion reason to actionable messages in all 14 commit call sites (SnapshotProducer, BaseTransaction, CatalogHandlers, etc.)
When retry exhaustion occurs during commit operations, check if the original cause is already a CommitFailedException before wrapping it in a new CommitFailedException. If so, re-throw the original to preserve its error message. This fixes backward compatibility with existing exception handling that relies on the original message.
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.
Summary
Fixes #16744.
When commit retry is exhausted, the failure message currently rethrows the underlying
CommitFailedExceptionwithout indicating why the retry loop stopped. This makes it hard for operators to know which table property to tune (commit.retry.num-retriesvscommit.retry.total-timeout-ms).This change:
RetryExhaustedExceptionwith aReasonenum (RETRY_LIMIT_EXCEEDED/TIMEOUT_EXCEEDED) inTasks.javaRetryExhaustedException(preserving the original exception as cause) when retry is exhaustedRetryExhaustedExceptionat all 14 commit call sites and translates the reason into actionable messages, e.g.:"Commit failed and retry timeout (60000 ms) reached. Consider increasing 'commit.retry.total-timeout-ms'""Commit failed and retry limit (4) reached. Consider increasing 'commit.retry.num-retries'"The design keeps the generic retry utility (
Tasks) unaware of Iceberg property names — classification happens inTasks, translation happens at commit call sites.Testing
./gradlew :iceberg-core:test --tests "org.apache.iceberg.util.TestTasks" ./gradlew :iceberg-core:compileJava