rdblue commented on code in PR #4464:
URL: https://github.com/apache/iceberg/pull/4464#discussion_r842938645
##########
core/src/main/java/org/apache/iceberg/BaseTransaction.java:
##########
@@ -437,6 +430,25 @@ private void commitSimpleTransaction() {
}
}
+ private void applyUpdates(TableOperations underlyingOps) {
+ if (base != underlyingOps.refresh()) {
+ TableMetadata oldBase = base;
+ // use refreshed the metadata
+ this.base = underlyingOps.current();
+ this.current = underlyingOps.current();
+ for (PendingUpdate update : updates) {
+ // re-commit each update in the chain to apply it and update current
+ try {
+ update.commit();
+ } catch (CommitFailedException e) {
+ // fallback to old base, so that it refreshes again on retry and
apply pending updates.
+ base = oldBase;
Review Comment:
> Say I have 3 updates to apply, first update is success and the second
update is failed because the first update is success. But doing a retry with
rebase may help in second commit to get success right?
It is extremely unlikely that retrying multiple times will fix the problem.
There are two main types of commit failures: validation failures (e.g.
conflicting write) and operations that don't support retry (like schema
update). Neither one benefits from retrying multiple times.
I think the right fix is to throw the inner `CommitFailedException` and
break out of the retry loop.
--
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]