This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new c2b830e1e74 Pick "[Fix](Tablet) Fix the issue of redundant loading of 
stale rowset  (#35768)" (#35882)
c2b830e1e74 is described below

commit c2b830e1e74fe198c2f10f42182ab44322b9bfd3
Author: plat1ko <[email protected]>
AuthorDate: Wed Jun 5 07:55:04 2024 +0800

    Pick "[Fix](Tablet) Fix the issue of redundant loading of stale rowset  
(#35768)" (#35882)
---
 be/src/common/config.cpp    | 3 +++
 be/src/common/config.h      | 3 +++
 be/src/olap/tablet_meta.cpp | 9 +--------
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp
index 6d0c866cebe..299f38cd7ca 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -1225,6 +1225,9 @@ DEFINE_mBool(ignore_schema_change_check, "false");
 //JVM monitoring enable. To prevent be from crashing due to jvm compatibility 
issues. The default setting is off.
 DEFINE_Bool(enable_jvm_monitor, "false");
 
+// Skip loading stale rowset meta when initializing `TabletMeta` from protobuf
+DEFINE_mBool(skip_loading_stale_rowset_meta, "false");
+
 // clang-format off
 #ifdef BE_TEST
 // test s3
diff --git a/be/src/common/config.h b/be/src/common/config.h
index b172a3406d6..5fccbec6285 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -1306,6 +1306,9 @@ DECLARE_mBool(ignore_schema_change_check);
 //JVM monitoring enable. To prevent be from crashing due to jvm compatibility 
issues.
 DECLARE_Bool(enable_jvm_monitor);
 
+// Skip loading stale rowset meta when initializing `TabletMeta` from protobuf
+DECLARE_mBool(skip_loading_stale_rowset_meta);
+
 #ifdef BE_TEST
 // test s3
 DECLARE_String(test_s3_resource);
diff --git a/be/src/olap/tablet_meta.cpp b/be/src/olap/tablet_meta.cpp
index 1b242499187..4414f7187cd 100644
--- a/be/src/olap/tablet_meta.cpp
+++ b/be/src/olap/tablet_meta.cpp
@@ -581,17 +581,10 @@ void TabletMeta::init_from_pb(const TabletMetaPB& 
tablet_meta_pb) {
         _rs_metas.push_back(std::move(rs_meta));
     }
 
-    // init _stale_rs_metas
-    for (auto& it : tablet_meta_pb.stale_rs_metas()) {
-        RowsetMetaSharedPtr rs_meta(new RowsetMeta());
-        rs_meta->init_from_pb(it);
-        _stale_rs_metas.push_back(std::move(rs_meta));
-    }
-
     // For mow table, delete bitmap of stale rowsets has not been persisted.
     // When be restart, query should not read the stale rowset, otherwise 
duplicate keys
     // will be read out. Therefore, we don't add them to _stale_rs_meta for 
mow table.
-    if (!_enable_unique_key_merge_on_write) {
+    if (!config::skip_loading_stale_rowset_meta && 
!_enable_unique_key_merge_on_write) {
         for (auto& it : tablet_meta_pb.stale_rs_metas()) {
             RowsetMetaSharedPtr rs_meta(new RowsetMeta());
             rs_meta->init_from_pb(it);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to