diff --git a/Cargo.lock b/Cargo.lock index c560f4686a..29bdceace7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2402,6 +2402,7 @@ dependencies = [ "futures-util", "humantime-serde", "hyper", + "log", "log-store", "meta-client", "meta-srv", diff --git a/src/common/runtime/src/repeated_task.rs b/src/common/runtime/src/repeated_task.rs index 4af75dc488..2a2ea6f2bb 100644 --- a/src/common/runtime/src/repeated_task.rs +++ b/src/common/runtime/src/repeated_task.rs @@ -94,7 +94,7 @@ impl RepeatedTask { *self.task_handle.lock().await = Some(handle); self.started.store(true, Ordering::Relaxed); - logging::info!( + logging::debug!( "Repeated task {} started with interval: {:?}", self.task_fn.name(), self.interval @@ -127,7 +127,7 @@ impl RepeatedTask { token.cancel(); handle.await.context(WaitGcTaskStopSnafu { name })?; - logging::info!("Repeated task {} stopped", name); + logging::debug!("Repeated task {} stopped", name); Ok(()) } } diff --git a/src/datanode/Cargo.toml b/src/datanode/Cargo.toml index febd4f98d3..9935a6c67b 100644 --- a/src/datanode/Cargo.toml +++ b/src/datanode/Cargo.toml @@ -38,6 +38,7 @@ futures = "0.3" futures-util.workspace = true hyper = { version = "0.14", features = ["full"] } humantime-serde = "1.1" +log = "0.4" log-store = { path = "../log-store" } meta-client = { path = "../meta-client" } meta-srv = { path = "../meta-srv", features = ["mock"] } diff --git a/src/datanode/src/instance.rs b/src/datanode/src/instance.rs index b8153104ea..c3860ddc4d 100644 --- a/src/datanode/src/instance.rs +++ b/src/datanode/src/instance.rs @@ -315,11 +315,22 @@ pub(crate) async fn new_object_store(store_config: &ObjectStoreConfig) -> Result ObjectStoreConfig::Oss { .. } => new_oss_object_store(store_config).await, }; + // Don't enable retry layer when using local file backend. + let object_store = if !matches!(store_config, ObjectStoreConfig::File(..)) { + object_store.map(|object_store| object_store.layer(RetryLayer::new().with_jitter())) + } else { + object_store + }; + object_store.map(|object_store| { object_store - .layer(RetryLayer::new().with_jitter()) .layer(MetricsLayer) - .layer(LoggingLayer::default()) + .layer( + LoggingLayer::default() + // Print the expected error only in DEBUG level. + // See https://docs.rs/opendal/latest/opendal/layers/struct.LoggingLayer.html#method.with_error_level + .with_error_level(Some(log::Level::Debug)), + ) .layer(TracingLayer) }) }