From 4fec48f2b5dd35a478151e364212877b68e9732d Mon Sep 17 00:00:00 2001 From: duguorong009 <80258679+duguorong009@users.noreply.github.com> Date: Wed, 6 Sep 2023 18:19:19 +0800 Subject: [PATCH] chore(pageserver): remove unnecessary logging in tenant task loops (#5188) Fixes #3830 by adding the `#[cfg(not(feature = "testing"))]` attribute to unnecessary loggings in `pageserver/src/tenant/tasks.rs`. Co-authored-by: Joonas Koivunen --- pageserver/src/tenant/tasks.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pageserver/src/tenant/tasks.rs b/pageserver/src/tenant/tasks.rs index c067a84471..df3ffd08d3 100644 --- a/pageserver/src/tenant/tasks.rs +++ b/pageserver/src/tenant/tasks.rs @@ -102,6 +102,7 @@ async fn compaction_loop(tenant: Arc, cancel: CancellationToken) { let started_at = Instant::now(); let sleep_duration = if period == Duration::ZERO { + #[cfg(not(feature = "testing"))] info!("automatic compaction is disabled"); // check again in 10 seconds, in case it's been enabled again. Duration::from_secs(10) @@ -166,6 +167,7 @@ async fn gc_loop(tenant: Arc, cancel: CancellationToken) { let gc_horizon = tenant.get_gc_horizon(); let sleep_duration = if period == Duration::ZERO || gc_horizon == 0 { + #[cfg(not(feature = "testing"))] info!("automatic GC is disabled"); // check again in 10 seconds, in case it's been enabled again. Duration::from_secs(10)