ayushtkn commented on code in PR #5138:
URL: https://github.com/apache/polaris/pull/5138#discussion_r3644029131


##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/CatalogHandlerUtils.java:
##########
@@ -513,7 +514,14 @@ public TableMetadata commit(TableOperations ops, 
UpdateTableRequest request) {
                 }
 
                 TableMetadata.Builder newMetadataBuilder = 
TableMetadata.buildFrom(newBase);
-                request.updates().forEach((update) -> 
update.applyTo(newMetadataBuilder));
+                try {
+                  request.updates().forEach((update) -> 
update.applyTo(newMetadataBuilder));
+                } catch (RetryableValidationException e) {
+                  // Surface as a retryable 409, matching Iceberg 
CatalogHandlers.commit.
+                  throw new ValidationFailureException(
+                      new CommitFailedException(
+                          e, "Validation failed, please retry: %s", 
e.getMessage()));

Review Comment:
   I added a comment above but this suggestion is wrong, the iceberg code also 
does that and has comment in case of conflict there is no point of server 
retry, the client has to retry
   
   
https://github.com/apache/iceberg/blob/6976e020b894f6a6777704df2b8c4458cb291ae9/core/src/main/java/org/apache/iceberg/rest/CatalogHandlers.java#L641-L648



##########
runtime/service/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalogHandler.java:
##########
@@ -1531,7 +1532,13 @@ public void commitTransaction(CommitTransactionRequest 
commitTransactionRequest)
               }
 
               // Apply updates to builder
-              singleUpdate.applyTo(metadataBuilder);
+              try {
+                singleUpdate.applyTo(metadataBuilder);
+              } catch (RetryableValidationException e) {
+                // Surface as a retryable 409, matching 
CatalogHandlerUtils.commit.
+                throw new CommitFailedException(
+                    e, "Validation failed, please retry: %s", e.getMessage());
+              }

Review Comment:
   added



-- 
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]

Reply via email to