Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
zwang28 committed Nov 11, 2024
1 parent a12bce3 commit c81820f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/meta/service/src/hummock_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ impl HummockManagerService for HummockServiceImpl {
Some(backup_manager_2),
)
.await
.inspect_err(|e| tracing::warn!(error = e.as_report(), "Failed to start GC."));
.inspect_err(|e| tracing::warn!(error = %e.as_report(), "Failed to start GC."));
});
Ok(Response::new(TriggerFullGcResponse { status: None }))
}
Expand Down
6 changes: 4 additions & 2 deletions src/meta/src/hummock/manager/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,8 @@ async fn test_hummock_compaction_task_heartbeat() {
let compactor_manager = hummock_manager.compactor_manager_ref_for_test();
let _tx = compactor_manager.add_compactor(context_id);

let (join_handle, shutdown_tx) = HummockManager::hummock_timer_task(hummock_manager.clone());
let (join_handle, shutdown_tx) =
HummockManager::hummock_timer_task(hummock_manager.clone(), None);

// No compaction task available.
assert!(hummock_manager
Expand Down Expand Up @@ -1079,7 +1080,8 @@ async fn test_hummock_compaction_task_heartbeat_removal_on_node_removal() {
let compactor_manager = hummock_manager.compactor_manager_ref_for_test();
let _tx = compactor_manager.add_compactor(context_id);

let (join_handle, shutdown_tx) = HummockManager::hummock_timer_task(hummock_manager.clone());
let (join_handle, shutdown_tx) =
HummockManager::hummock_timer_task(hummock_manager.clone(), None);

// No compaction task available.
assert!(hummock_manager
Expand Down
2 changes: 1 addition & 1 deletion src/meta/src/hummock/manager/timer_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ impl HummockManager {
)
.await
.inspect_err(|e| {
warn!(error = e.as_report(), "Failed to start GC.")
warn!(error = %e.as_report(), "Failed to start GC.")
});
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/meta/src/hummock/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub fn start_hummock_workers(

/// Starts a task to periodically vacuum stale metadata.
pub fn start_vacuum_metadata_loop(
vacuum: HummockManagerRef,
hummock_manager: HummockManagerRef,
interval: Duration,
) -> (JoinHandle<()>, Sender<()>) {
let (shutdown_tx, mut shutdown_rx) = tokio::sync::oneshot::channel();
Expand All @@ -75,7 +75,7 @@ pub fn start_vacuum_metadata_loop(
return;
}
}
if let Err(err) = vacuum.delete_metadata().await {
if let Err(err) = hummock_manager.delete_metadata().await {
tracing::warn!(error = %err.as_report(), "Vacuum metadata error");
}
}
Expand Down
16 changes: 8 additions & 8 deletions src/storage/src/hummock/compactor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,11 +553,11 @@ pub fn start_compactor(
}
});
}
ResponseEvent::VacuumTask(vacuum_task) => {
tracing::error!(?vacuum_task, "unexpected vacuum task");
ResponseEvent::VacuumTask(_) => {
unreachable!("unexpected vacuum task");
}
ResponseEvent::FullScanTask(full_scan_task) => {
tracing::error!(?full_scan_task, "unexpected scan task");
ResponseEvent::FullScanTask(_) => {
unreachable!("unexpected scan task");
}
ResponseEvent::ValidationTask(validation_task) => {
let validation_task = ValidationTask::from(validation_task);
Expand Down Expand Up @@ -725,11 +725,11 @@ pub fn start_shared_compactor(
}

}
dispatch_compaction_task_request::Task::VacuumTask(vacuum_task) => {
tracing::error!(?vacuum_task, "unexpected vacuum task");
dispatch_compaction_task_request::Task::VacuumTask(_) => {
unreachable!("unexpected vacuum task");
}
dispatch_compaction_task_request::Task::FullScanTask(full_scan_task) => {
tracing::error!(?full_scan_task, "unexpected scan task");
dispatch_compaction_task_request::Task::FullScanTask(_) => {
unreachable!("unexpected scan task");
}
dispatch_compaction_task_request::Task::ValidationTask(validation_task) => {
let validation_task = ValidationTask::from(validation_task);
Expand Down

0 comments on commit c81820f

Please sign in to comment.