From 38043fade2cafeae2497872b85ceef5df618a18e Mon Sep 17 00:00:00 2001 From: jinhelin Date: Mon, 28 Mar 2022 13:46:46 +0800 Subject: [PATCH] Fix data race. --- dbms/src/Storages/DeltaMerge/DeltaIndexManager.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dbms/src/Storages/DeltaMerge/DeltaIndexManager.cpp b/dbms/src/Storages/DeltaMerge/DeltaIndexManager.cpp index 0c5a8d4661e..40ae888ab77 100644 --- a/dbms/src/Storages/DeltaMerge/DeltaIndexManager.cpp +++ b/dbms/src/Storages/DeltaMerge/DeltaIndexManager.cpp @@ -79,9 +79,8 @@ void DeltaIndexManager::refreshRef(const DeltaIndexPtr & index) current_size += holder.size; removeOverflow(removed); + CurrentMetrics::set(CurrentMetrics::DT_DeltaIndexCacheSize, current_size); } - - CurrentMetrics::set(CurrentMetrics::DT_DeltaIndexCacheSize, current_size); } void DeltaIndexManager::deleteRef(const DeltaIndexPtr & index) @@ -111,9 +110,8 @@ void DeltaIndexManager::deleteRef(const DeltaIndexPtr & index) lru_queue.erase(holder.queue_it); // Remove it later index_map.erase(it); + CurrentMetrics::set(CurrentMetrics::DT_DeltaIndexCacheSize, current_size); } - - CurrentMetrics::set(CurrentMetrics::DT_DeltaIndexCacheSize, current_size); } DeltaIndexPtr DeltaIndexManager::getRef(UInt64 index_id)