Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions crates/iceberg/src/io/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

use std::sync::Arc;

use opendal::layers::RetryLayer;
#[cfg(feature = "storage-gcs")]
use opendal::services::GcsConfig;
#[cfg(feature = "storage-s3")]
Expand Down Expand Up @@ -94,7 +95,7 @@ impl Storage {
path: &'a impl AsRef<str>,
) -> crate::Result<(Operator, &'a str)> {
let path = path.as_ref();
match self {
let (operator, relative_path): (Operator, &str) = match self {
#[cfg(feature = "storage-memory")]
Storage::Memory(op) => {
if let Some(stripped) = path.strip_prefix("memory:/") {
Expand Down Expand Up @@ -155,7 +156,13 @@ impl Storage {
ErrorKind::FeatureUnsupported,
"No storage service has been enabled",
)),
}
}?;

// Transient errors are common for object stores; however there's no
// harm in retrying temporary failures for other storage backends as well.
let operator = operator.layer(RetryLayer::new());

Ok((operator, relative_path))
}

/// Parse scheme.
Expand Down