diff --git a/rust/lance-table/src/io/commit.rs b/rust/lance-table/src/io/commit.rs index 9b5ff6c84e8..96d7267e1bf 100644 --- a/rust/lance-table/src/io/commit.rs +++ b/rust/lance-table/src/io/commit.rs @@ -678,7 +678,7 @@ async fn build_dynamodb_external_store( ) -> Result> { use super::commit::dynamodb::DynamoDBExternalManifestStore; use aws_sdk_dynamodb::{ - config::{IdentityCache, Region}, + config::{retry::RetryConfig, IdentityCache, Region}, Client, }; @@ -687,7 +687,10 @@ async fn build_dynamodb_external_store( .region(Some(Region::new(region.to_string()))) .credentials_provider(OSObjectStoreToAwsCredAdaptor(creds)) // caching should be handled by passed AwsCredentialProvider - .identity_cache(IdentityCache::no_cache()); + .identity_cache(IdentityCache::no_cache()) + // Be more resilient to transient network issues. + // 5 attempts = 1 initial + 4 retries with exponential backoff. + .retry_config(RetryConfig::standard().with_max_attempts(5)); if let Some(endpoint) = endpoint { dynamodb_config = dynamodb_config.endpoint_url(endpoint); diff --git a/rust/lance-table/src/io/commit/dynamodb.rs b/rust/lance-table/src/io/commit/dynamodb.rs index 3f508c765a5..9db7ce5027e 100644 --- a/rust/lance-table/src/io/commit/dynamodb.rs +++ b/rust/lance-table/src/io/commit/dynamodb.rs @@ -21,6 +21,7 @@ use object_store::path::Path; use snafu::location; use snafu::OptionExt; use tokio::sync::RwLock; +use tracing::warn; use crate::io::commit::external_manifest::ExternalManifestStore; use lance_core::error::box_error; @@ -82,7 +83,14 @@ where E: std::error::Error + Send + Sync + 'static, { fn wrap_err(self) -> Result { - self.map_err(|err| Error::from(WrappedSdkError(err))) + self.map_err(|err| { + warn!( + target: "lance::dynamodb", + request_id = err.request_id().unwrap_or("unknown"), + "DynamoDB SDK error: {err:?}", + ); + Error::from(WrappedSdkError(err)) + }) } }