From 43a79e5d565f51f7d3b369d18471d974b6cd59a3 Mon Sep 17 00:00:00 2001 From: obdev Date: Tue, 21 Mar 2023 16:15:28 +0000 Subject: [PATCH] reset tablet_allocator before release tenant --- src/observer/virtual_table/ob_all_virtual_table_mgr.cpp | 1 + .../virtual_table/ob_all_virtual_tablet_compaction_info.cpp | 2 ++ .../ob_all_virtual_tablet_sstable_macro_info.cpp | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/src/observer/virtual_table/ob_all_virtual_table_mgr.cpp b/src/observer/virtual_table/ob_all_virtual_table_mgr.cpp index de93261d91..78ad19983f 100644 --- a/src/observer/virtual_table/ob_all_virtual_table_mgr.cpp +++ b/src/observer/virtual_table/ob_all_virtual_table_mgr.cpp @@ -95,6 +95,7 @@ void ObAllVirtualTableMgr::release_last_tenant() tablet_iter_->~ObTenantTabletIterator(); tablet_iter_ = nullptr; } + tablet_allocator_.reset(); } bool ObAllVirtualTableMgr::is_need_process(uint64_t tenant_id) diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_compaction_info.cpp b/src/observer/virtual_table/ob_all_virtual_tablet_compaction_info.cpp index 6e7107f718..f9bd0a59d3 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_compaction_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tablet_compaction_info.cpp @@ -93,6 +93,8 @@ void ObAllVirtualTabletCompactionInfo::release_last_tenant() tablet_iter_->~ObTenantTabletIterator(); tablet_iter_ = nullptr; } + tablet_handle_.reset(); + tablet_allocator_.reset(); } bool ObAllVirtualTabletCompactionInfo::is_need_process(uint64_t tenant_id) diff --git a/src/observer/virtual_table/ob_all_virtual_tablet_sstable_macro_info.cpp b/src/observer/virtual_table/ob_all_virtual_tablet_sstable_macro_info.cpp index 6eda8bf9d1..af01306e80 100644 --- a/src/observer/virtual_table/ob_all_virtual_tablet_sstable_macro_info.cpp +++ b/src/observer/virtual_table/ob_all_virtual_tablet_sstable_macro_info.cpp @@ -34,6 +34,7 @@ ObAllVirtualTabletSSTableMacroInfo::MacroInfo::MacroInfo() data_checksum_(0), occupy_size_(0), original_size_(0), + data_size_(0), data_zsize_(0), store_range_(), row_count_(0), @@ -56,6 +57,7 @@ void ObAllVirtualTabletSSTableMacroInfo::MacroInfo::reset() data_checksum_ = 0; occupy_size_ = 0; original_size_ = 0; + data_size_ = 0; data_zsize_ = 0; store_range_.reset(); row_count_ = 0; @@ -467,6 +469,7 @@ void ObAllVirtualTabletSSTableMacroInfo::release_last_tenant() macro_iter_ = nullptr; } curr_range_.reset(); + tablet_allocator_.reset(); } bool ObAllVirtualTabletSSTableMacroInfo::is_need_process(uint64_t tenant_id) @@ -513,6 +516,8 @@ int ObAllVirtualTabletSSTableMacroInfo::get_next_tablet() } } while(OB_SUCC(ret)) { + tablet_handle_.reset(); + tablet_allocator_.reuse(); if (OB_FAIL(tablet_iter_->get_next_tablet(tablet_handle_))) { if (OB_UNLIKELY(OB_ITER_END != ret)) { SERVER_LOG(WARN, "fail to get tablet iter", K(ret));