-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Do not retry iceberg operations on unrecoverable exceptions #19307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| /* | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package io.trino.filesystem; | ||
|
|
||
| import java.io.IOException; | ||
|
|
||
| /** | ||
| * This exception is for stopping retries for FileSystem calls that shouldn't be retried. | ||
| */ | ||
| public class UnrecoverableIOException | ||
| extends IOException | ||
| { | ||
| public UnrecoverableIOException(String message, Throwable cause) | ||
| { | ||
| super(message, cause); | ||
| } | ||
|
|
||
| public UnrecoverableIOException(String message) | ||
| { | ||
| super(message); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,6 +90,7 @@ | |
| import io.airlift.units.Duration; | ||
| import io.opentelemetry.api.OpenTelemetry; | ||
| import io.opentelemetry.instrumentation.awssdk.v1_11.AwsSdkTelemetry; | ||
| import io.trino.filesystem.UnrecoverableIOException; | ||
| import io.trino.hdfs.FSDataInputStreamTail; | ||
| import io.trino.hdfs.FileSystemWithBatchDelete; | ||
| import io.trino.hdfs.MemoryAwareFileSystem; | ||
|
|
@@ -934,17 +935,12 @@ private static boolean isHadoopFolderMarker(S3ObjectSummary object) | |
| return object.getKey().endsWith("_$folder$"); | ||
| } | ||
|
|
||
| /** | ||
|
||
| * This exception is for stopping retries for S3 calls that shouldn't be retried. | ||
| * For example, "Caused by: com.amazonaws.services.s3.model.AmazonS3Exception: Forbidden (Service: Amazon S3; Status Code: 403 ..." | ||
| */ | ||
| public static class UnrecoverableS3OperationException | ||
| extends IOException | ||
| static class UnrecoverableS3OperationException | ||
| extends UnrecoverableIOException | ||
| { | ||
| public UnrecoverableS3OperationException(String bucket, String key, Throwable cause) | ||
| { | ||
| // append bucket and key to the message | ||
| super(format("%s (Bucket: %s, Key: %s)", cause, bucket, key)); | ||
| super(format("%s (Bucket: %s, Key: %s)", cause, bucket, key), cause); | ||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I think this method can be static?