huaxingao commented on code in PR #15148:
URL: https://github.com/apache/iceberg/pull/15148#discussion_r2748215476
##########
core/src/main/java/org/apache/iceberg/SetStatistics.java:
##########
@@ -45,17 +59,28 @@ public UpdateStatistics removeStatistics(long snapshotId) {
@Override
public List<StatisticsFile> apply() {
- return internalApply(ops.current()).statisticsFiles();
+ return internalApply().statisticsFiles();
}
@Override
public void commit() {
- TableMetadata base = ops.current();
- TableMetadata newMetadata = internalApply(base);
- ops.commit(base, newMetadata);
+ Tasks.foreach(ops)
+ .retry(base.propertyAsInt(COMMIT_NUM_RETRIES,
COMMIT_NUM_RETRIES_DEFAULT))
+ .exponentialBackoff(
+ base.propertyAsInt(COMMIT_MIN_RETRY_WAIT_MS,
COMMIT_MIN_RETRY_WAIT_MS_DEFAULT),
+ base.propertyAsInt(COMMIT_MAX_RETRY_WAIT_MS,
COMMIT_MAX_RETRY_WAIT_MS_DEFAULT),
+ base.propertyAsInt(COMMIT_TOTAL_RETRY_TIME_MS,
COMMIT_TOTAL_RETRY_TIME_MS_DEFAULT),
+ 2.0 /* exponential */)
+ .onlyRetryOn(CommitFailedException.class)
+ .run(
+ item -> {
Review Comment:
nit: `item` is not used
##########
core/src/main/java/org/apache/iceberg/SetStatistics.java:
##########
@@ -45,17 +59,28 @@ public UpdateStatistics removeStatistics(long snapshotId) {
@Override
public List<StatisticsFile> apply() {
- return internalApply(ops.current()).statisticsFiles();
+ return internalApply().statisticsFiles();
}
@Override
public void commit() {
- TableMetadata base = ops.current();
- TableMetadata newMetadata = internalApply(base);
- ops.commit(base, newMetadata);
+ Tasks.foreach(ops)
+ .retry(base.propertyAsInt(COMMIT_NUM_RETRIES,
COMMIT_NUM_RETRIES_DEFAULT))
Review Comment:
retry config is pulled from base initialized at construction time. If table
properties change between construction and commit(), retries won’t pick that up.
--
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]