-
Notifications
You must be signed in to change notification settings - Fork 281
Replace CommitFailedException with CommitConflictException #2198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace CommitFailedException with CommitConflictException #2198
Conversation
In some cases, we were using CommitFailedException to represent commit conflicts, which returns the correct 409 response but is tied to Iceberg. However, some of these conflicts originate from Polaris, making CommitConflictException a more appropriate and accurate choice. This change updates those instances to improve clarity and exception handling semantics. Resolves apache#2168
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution, @tmater ! The changes LGTM overall.
...e/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dimas-b , thank you for the review!
Updated the change, LMK your thoughts.
...e/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 Thanks, @tmater !
@@ -635,7 +635,7 @@ paths: | |||
TableToUpdateDoesNotExist: | |||
$ref: '#/components/examples/NoSuchTableError' | |||
'409': | |||
description: Conflict - CommitFailedException, one or more requirements failed. The client may retry. | |||
description: Conflict - Transaction commit failed due to concurrent modifications. The client may retry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is generated; the change should go into the appropriate spec and then this file needs to be regenerated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point about spec change.
However, the code fix in this PR does not require spec changes. I believe the client-facing behaviour is not changed by this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tmater : please rollback changes to this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, reverted it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spec change here wasn't implemented correctly, but otherwise the change seems reasonable if inconsequential
In some cases, we were using CommitFailedException to represent commit conflicts, which returns the correct 409 response but is tied to Iceberg.
However, some of these conflicts originate from Polaris, making CommitConflictException a more appropriate and accurate choice.
This change updates those instances to improve clarity and exception handling semantics.
Resolves #2168