diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp index b1b18ed0ed0a34..e754917e016f8f 100644 --- a/be/src/common/config.cpp +++ b/be/src/common/config.cpp @@ -1289,6 +1289,9 @@ DEFINE_Int64(s3_file_system_local_upload_buffer_size, "5242880"); //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 8df54c25318cad..b1a825a462bdee 100644 --- a/be/src/common/config.h +++ b/be/src/common/config.h @@ -1367,6 +1367,9 @@ DECLARE_Int64(s3_file_system_local_upload_buffer_size); //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 b148ac44b221bf..43f31a9756d72a 100644 --- a/be/src/olap/tablet_meta.cpp +++ b/be/src/olap/tablet_meta.cpp @@ -574,17 +574,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);