From 8dcf48fe1b233d7d8cdd63f482846cd9e3018565 Mon Sep 17 00:00:00 2001 From: WenyXu Date: Tue, 5 Nov 2024 07:10:50 +0000 Subject: [PATCH] chore: add logs for drop database --- src/common/meta/src/ddl/drop_database/cursor.rs | 5 ++++- src/common/meta/src/ddl/drop_database/executor.rs | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/meta/src/ddl/drop_database/cursor.rs b/src/common/meta/src/ddl/drop_database/cursor.rs index 3b25b4202539..ab4e70a7a05f 100644 --- a/src/common/meta/src/ddl/drop_database/cursor.rs +++ b/src/common/meta/src/ddl/drop_database/cursor.rs @@ -16,6 +16,7 @@ use std::any::Any; use common_catalog::format_full_table_name; use common_procedure::Status; +use common_telemetry::info; use futures::TryStreamExt; use serde::{Deserialize, Serialize}; use snafu::OptionExt; @@ -72,7 +73,7 @@ impl DropDatabaseCursor { match (self.target, table_route_value) { (DropTableTarget::Logical, TableRouteValue::Logical(route)) => { let physical_table_id = route.physical_table_id(); - + info!("Drop database: fetching physical table route for drop database"); let (_, table_route) = ddl_ctx .table_metadata_manager .table_route_manager() @@ -150,6 +151,7 @@ impl State for DropDatabaseCursor { ctx: &mut DropDatabaseContext, ) -> Result<(Box, Status)> { if ctx.tables.as_deref().is_none() { + info!("Drop database: fetching tables for drop database"); let tables = ddl_ctx .table_metadata_manager .table_name_manager() @@ -161,6 +163,7 @@ impl State for DropDatabaseCursor { Some((table_name, table_name_value)) => { let table_id = table_name_value.table_id(); + info!("Drop database: fetching table info for drop database"); let table_info_value = ddl_ctx .table_metadata_manager .table_info_manager() diff --git a/src/common/meta/src/ddl/drop_database/executor.rs b/src/common/meta/src/ddl/drop_database/executor.rs index a8d8ed9d1ffc..9275bfb71a51 100644 --- a/src/common/meta/src/ddl/drop_database/executor.rs +++ b/src/common/meta/src/ddl/drop_database/executor.rs @@ -99,6 +99,7 @@ impl State for DropDatabaseExecutor { ctx: &mut DropDatabaseContext, ) -> Result<(Box, Status)> { self.register_dropping_regions(ddl_ctx)?; + info!("Drop database: drop table metadata: {}", self.table_name); let executor = DropTableExecutor::new(ctx.cluster_id, self.table_name.clone(), self.table_id, true); // Deletes metadata for table permanently. @@ -111,6 +112,7 @@ impl State for DropDatabaseExecutor { .on_destroy_metadata(ddl_ctx, &table_route_value) .await?; executor.invalidate_table_cache(ddl_ctx).await?; + info!("Drop database: drop regions: {}", self.table_name); executor .on_drop_regions(ddl_ctx, &self.physical_region_routes) .await?;