From a12bce308414410eef6a6d55ac8b586d8386780f Mon Sep 17 00:00:00 2001 From: zwang28 <84491488@qq.com> Date: Mon, 11 Nov 2024 16:32:24 +0800 Subject: [PATCH] refactor --- src/meta/service/src/hummock_service.rs | 3 ++- src/meta/src/hummock/manager/timer_task.rs | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/meta/service/src/hummock_service.rs b/src/meta/service/src/hummock_service.rs index f9a556009999e..ad634b4c5daf9 100644 --- a/src/meta/service/src/hummock_service.rs +++ b/src/meta/service/src/hummock_service.rs @@ -242,6 +242,7 @@ impl HummockManagerService for HummockServiceImpl { let backup_manager_2 = self.backup_manager.clone(); let hummock_manager_2 = self.hummock_manager.clone(); tokio::task::spawn(async move { + use thiserror_ext::AsReport; let _ = hummock_manager_2 .start_full_gc( Duration::from_secs(req.sst_retention_time_sec), @@ -249,7 +250,7 @@ impl HummockManagerService for HummockServiceImpl { Some(backup_manager_2), ) .await - .inspect_err(|e| tracing::warn!(?e, "Failed to start GC.")); + .inspect_err(|e| tracing::warn!(error = e.as_report(), "Failed to start GC.")); }); Ok(Response::new(TriggerFullGcResponse { status: None })) } diff --git a/src/meta/src/hummock/manager/timer_task.rs b/src/meta/src/hummock/manager/timer_task.rs index e68c5e0ec0d08..1e9c9b5699c8c 100644 --- a/src/meta/src/hummock/manager/timer_task.rs +++ b/src/meta/src/hummock/manager/timer_task.rs @@ -440,6 +440,7 @@ impl HummockManager { let backup_manager_2 = backup_manager.clone(); let hummock_manager_2 = hummock_manager.clone(); tokio::task::spawn(async move { + use thiserror_ext::AsReport; let _ = hummock_manager_2 .start_full_gc( Duration::from_secs(retention_sec), @@ -447,7 +448,9 @@ impl HummockManager { backup_manager_2, ) .await - .inspect_err(|e| warn!(?e, "Failed to start GC.")); + .inspect_err(|e| { + warn!(error = e.as_report(), "Failed to start GC.") + }); }); } }