singhpk234 commented on code in PR #12818:
URL: https://github.com/apache/iceberg/pull/12818#discussion_r2105887401
##########
core/src/main/java/org/apache/iceberg/rest/ErrorHandlers.java:
##########
@@ -91,9 +91,22 @@ public void accept(ErrorResponse error) {
case 404:
throw new NoSuchTableException("%s", error.message());
case 409:
- throw new CommitFailedException("Commit failed: %s",
error.message());
+ if (error.isRetried()) {
+ // If the request was retried, and if it final error was 409, it
could probably also
+ // mean that HTTP retries happened, and the IRC service would have
actually applied
+ // the commit in the persistence during the retries by still gave
back 5xx.
+ // This would now mean since the base has changed it would
conflict with itself,
+ // in cases like this its best not to mark this as failed instead
make this is
+ // a commit state unknown.
+ throw new CommitStateUnknownException(
+ new RESTException(
+ "Commit status unknown, due to retries: %s: %s",
+ error.code(), error.message()));
+ } else {
+ throw new CommitFailedException("Commit failed: %s",
error.message());
+ }
+
case 500:
- case 502:
Review Comment:
Opps typo, let me remove.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]