From c16bb0ad0342a701cf0c70fc1c27aabb1e2d7213 Mon Sep 17 00:00:00 2001 From: lidezhu Date: Sun, 26 Jun 2022 20:23:41 +0800 Subject: [PATCH] remove unnecessary change --- dbms/src/Storages/DeltaMerge/Segment.cpp | 4 +--- dbms/src/Storages/StorageDeltaMerge.h | 2 +- dbms/src/Storages/Transaction/RegionTable.cpp | 5 +---- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/dbms/src/Storages/DeltaMerge/Segment.cpp b/dbms/src/Storages/DeltaMerge/Segment.cpp index 83755002fa5..8398fdcee40 100644 --- a/dbms/src/Storages/DeltaMerge/Segment.cpp +++ b/dbms/src/Storages/DeltaMerge/Segment.cpp @@ -1333,9 +1333,7 @@ bool Segment::compactDelta(DMContext & dm_context) CurrentMetrics::Increment cur_dm_segments{CurrentMetrics::DT_DeltaCompact}; GET_METRIC(tiflash_storage_subtask_count, type_delta_compact).Increment(); Stopwatch watch; - SCOPE_EXIT({ - GET_METRIC(tiflash_storage_subtask_duration_seconds, type_delta_compact).Observe(watch.elapsedSeconds()); - }); + SCOPE_EXIT({ GET_METRIC(tiflash_storage_subtask_duration_seconds, type_delta_compact).Observe(watch.elapsedSeconds()); }); return delta->compact(dm_context); } diff --git a/dbms/src/Storages/StorageDeltaMerge.h b/dbms/src/Storages/StorageDeltaMerge.h index 0b34008640e..9e4ab12ad4f 100644 --- a/dbms/src/Storages/StorageDeltaMerge.h +++ b/dbms/src/Storages/StorageDeltaMerge.h @@ -73,7 +73,7 @@ class StorageDeltaMerge void flushCache(const Context & context) override; - bool flushCache(const Context & context, const DM::RowKeyRange & range_to_flush, bool try_until_succeed = true) override; + bool flushCache(const Context & context, const DM::RowKeyRange & range_to_flush, bool try_until_succeed) override; /// Merge delta into the stable layer for all segments. /// diff --git a/dbms/src/Storages/Transaction/RegionTable.cpp b/dbms/src/Storages/Transaction/RegionTable.cpp index 86430ee29d2..5ae36a4bd64 100644 --- a/dbms/src/Storages/Transaction/RegionTable.cpp +++ b/dbms/src/Storages/Transaction/RegionTable.cpp @@ -230,10 +230,7 @@ void removeObsoleteDataInStorage( auto rowkey_range = DM::RowKeyRange::fromRegionRange(handle_range, table_id, table_id, storage->isCommonHandle(), storage->getRowKeyColumnSize()); dm_storage->deleteRange(rowkey_range, context->getSettingsRef()); - // flush to disk and keep try until success - while (!dm_storage->flushCache(*context, rowkey_range)) - { - } + dm_storage->flushCache(*context, rowkey_range, /*try_until_succeed*/ true); // flush to disk } catch (DB::Exception & e) {