From 8dee36744ae9ecfe9dda0522fef1634e37d23e87 Mon Sep 17 00:00:00 2001 From: ti-srebot <66930949+ti-srebot@users.noreply.github.com> Date: Tue, 23 Jun 2020 17:00:30 +0800 Subject: [PATCH] Add logging for possibly deadlocks (#816) (#819) * Add logging for possibly deadlocks Signed-off-by: JaySon-Huang * Address comments Signed-off-by: JaySon-Huang * Apply suggestions from code review Co-authored-by: JaySon-Huang Co-authored-by: JaySon --- dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp | 2 +- dbms/src/Storages/Transaction/KVStore.cpp | 1 + dbms/src/Storages/Transaction/RegionTable.cpp | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp b/dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp index c702639e5d5..64be7cf2ea5 100644 --- a/dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp +++ b/dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp @@ -476,7 +476,7 @@ void DeltaMergeStore::write(const Context & db_context, const DB::Settings & db_ void DeltaMergeStore::deleteRange(const Context & db_context, const DB::Settings & db_settings, const HandleRange & delete_range) { - LOG_TRACE(log, "Write into " << db_name << "." << table_name << " delte range " << delete_range.toString()); + LOG_INFO(log, "Write into " << db_name << "." << table_name << " delte range " << delete_range.toString()); EventRecorder write_block_recorder(ProfileEvents::DMDeleteRange, ProfileEvents::DMDeleteRangeNS); diff --git a/dbms/src/Storages/Transaction/KVStore.cpp b/dbms/src/Storages/Transaction/KVStore.cpp index 649c5e6cb5a..aa736209178 100644 --- a/dbms/src/Storages/Transaction/KVStore.cpp +++ b/dbms/src/Storages/Transaction/KVStore.cpp @@ -202,6 +202,7 @@ void KVStore::removeRegion(const RegionID region_id, bool remove_data, RegionTab } region_persister.drop(region_id, region_lock); + LOG_INFO(log, "Persisted [region " << region_id << "] deleted"); region_table.removeRegion(region_id, remove_data, region_lock); diff --git a/dbms/src/Storages/Transaction/RegionTable.cpp b/dbms/src/Storages/Transaction/RegionTable.cpp index add9cc403d0..fba6b0dcdf1 100644 --- a/dbms/src/Storages/Transaction/RegionTable.cpp +++ b/dbms/src/Storages/Transaction/RegionTable.cpp @@ -285,6 +285,7 @@ void RegionTable::removeRegion(const RegionID region_id, bool remove_data, const table_to_optimize.insert(table_id); tables.erase(table_id); } + LOG_INFO(log, __FUNCTION__ << ": remove [region " << region_id << "] in RegionTable done"); } // Sometime we don't need to remove data. e.g. remove region after region merge. @@ -299,6 +300,7 @@ void RegionTable::removeRegion(const RegionID region_id, bool remove_data, const // before `removeObsoleteDataInStorage` is done. (by param `RegionTaskLock`) // And this is expected not to block for long time. removeObsoleteDataInStorage(context, table_id, handle_range); + LOG_INFO(log, __FUNCTION__ << ": remove region [" << region_id << "] in storage done"); } }