Skip to content

Commit

Permalink
Do not retry iceberg operations on unrecoverable exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
oskar-szwajkowski committed Jul 15, 2024
1 parent 57b7b03 commit 6b44756
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import dev.failsafe.RetryPolicy;
import io.trino.annotation.NotThreadSafe;
import io.trino.filesystem.Location;
import io.trino.filesystem.UnrecoverableIOException;
import io.trino.plugin.hive.metastore.Column;
import io.trino.plugin.hive.metastore.StorageFormat;
import io.trino.plugin.iceberg.util.HiveSchemaUtil;
Expand Down Expand Up @@ -260,7 +261,8 @@ protected void refreshFromMetadataLocation(String newLocation, Function<String,
.withMaxRetries(20)
.withBackoff(100, 5000, MILLIS, 4.0)
.withMaxDuration(Duration.ofMinutes(10))
.abortOn(failure -> failure instanceof ValidationException || isNotFoundException(failure))
.abortOn(ValidationException.class, UnrecoverableIOException.class)
.abortOn(AbstractIcebergTableOperations::isNotFoundException)
.build())
.get(() -> metadataLoader.apply(newLocation));
}
Expand Down

0 comments on commit 6b44756

Please sign in to comment.