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

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


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new ca173ce89c2 branch-3.0: [opt](test)Optimize index compaction UT test 
config with log scene #46170 (#46208)
ca173ce89c2 is described below

commit ca173ce89c20687aaa12993b159267538a038180
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Jan 13 21:37:37 2025 +0800

    branch-3.0: [opt](test)Optimize index compaction UT test config with log 
scene #46170 (#46208)
    
    Cherry-picked from #46170
    
    Co-authored-by: qiye <l...@selectdb.com>
---
 .../index_compaction_performance_test.cpp           | 21 ++++++++++++++++++---
 .../compaction/index_compaction_test.cpp            | 15 ++++++++++++++-
 2 files changed, 32 insertions(+), 4 deletions(-)

diff --git 
a/be/test/olap/rowset/segment_v2/inverted_index/compaction/index_compaction_performance_test.cpp
 
b/be/test/olap/rowset/segment_v2/inverted_index/compaction/index_compaction_performance_test.cpp
index 566680e8b1e..4d579a5541e 100644
--- 
a/be/test/olap/rowset/segment_v2/inverted_index/compaction/index_compaction_performance_test.cpp
+++ 
b/be/test/olap/rowset/segment_v2/inverted_index/compaction/index_compaction_performance_test.cpp
@@ -60,10 +60,15 @@ protected:
         _data_dir = std::make_unique<DataDir>(*_engine_ref, _absolute_dir);
         static_cast<void>(_data_dir->update_capacity());
         ExecEnv::GetInstance()->set_storage_engine(std::move(engine));
-        config::enable_segcompaction = false;
-        config::string_type_length_soft_limit_bytes = 2147483643;
+
+        // set config
         config::inverted_index_dict_path =
                 _current_dir + 
"/be/src/clucene/src/contribs-lib/CLucene/analysis/jieba/dict";
+        config::enable_segcompaction = false;
+        config::enable_ordered_data_compaction = false;
+        config::total_permits_for_compaction_score = 200000;
+        config::inverted_index_ram_dir_enable = true;
+        config::string_type_length_soft_limit_bytes = 10485760;
     }
     void TearDown() override {
         
EXPECT_TRUE(io::global_local_filesystem()->delete_directory(_tablet->tablet_path()).ok());
@@ -71,6 +76,16 @@ protected:
         
EXPECT_TRUE(io::global_local_filesystem()->delete_directory(tmp_dir).ok());
         _engine_ref = nullptr;
         ExecEnv::GetInstance()->set_storage_engine(nullptr);
+
+        // restore config
+        config::inverted_index_max_buffered_docs = -1;
+        config::compaction_batch_size = -1;
+        config::inverted_index_compaction_enable = false;
+        config::enable_segcompaction = true;
+        config::enable_ordered_data_compaction = true;
+        config::total_permits_for_compaction_score = 1000000;
+        config::inverted_index_ram_dir_enable = true;
+        config::string_type_length_soft_limit_bytes = 1048576;
     }
 
     DISABLED_IndexCompactionPerformanceTest() = default;
@@ -130,7 +145,7 @@ protected:
         auto custom_check_build_rowsets = [](const int32_t& size) { 
EXPECT_EQ(size, 1); };
         IndexCompactionUtils::build_rowsets<IndexCompactionUtils::WikiDataRow>(
                 _data_dir, _tablet_schema, _tablet, _engine_ref, rowsets, 
data_files, _inc_id,
-                custom_check_build_rowsets, true);
+                custom_check_build_rowsets, true, INT32_MAX);
 
         auto custom_check_index = [](const BaseCompaction& compaction,
                                      const RowsetWriterContext& ctx) {
diff --git 
a/be/test/olap/rowset/segment_v2/inverted_index/compaction/index_compaction_test.cpp
 
b/be/test/olap/rowset/segment_v2/inverted_index/compaction/index_compaction_test.cpp
index 64aec3ffa4a..33b35e4ef44 100644
--- 
a/be/test/olap/rowset/segment_v2/inverted_index/compaction/index_compaction_test.cpp
+++ 
b/be/test/olap/rowset/segment_v2/inverted_index/compaction/index_compaction_test.cpp
@@ -56,8 +56,15 @@ protected:
         _data_dir = std::make_unique<DataDir>(*_engine_ref, _absolute_dir);
         static_cast<void>(_data_dir->update_capacity());
         ExecEnv::GetInstance()->set_storage_engine(std::move(engine));
+
+        // set config
         config::inverted_index_dict_path =
                 _current_dir + 
"/be/src/clucene/src/contribs-lib/CLucene/analysis/jieba/dict";
+        config::enable_segcompaction = false;
+        config::enable_ordered_data_compaction = false;
+        config::total_permits_for_compaction_score = 200000;
+        config::inverted_index_ram_dir_enable = true;
+        config::string_type_length_soft_limit_bytes = 10485760;
     }
     void TearDown() override {
         
EXPECT_TRUE(io::global_local_filesystem()->delete_directory(_tablet->tablet_path()).ok());
@@ -65,10 +72,16 @@ protected:
         
EXPECT_TRUE(io::global_local_filesystem()->delete_directory(tmp_dir).ok());
         _engine_ref = nullptr;
         ExecEnv::GetInstance()->set_storage_engine(nullptr);
-        // reset config
+
+        // restore config
         config::inverted_index_max_buffered_docs = -1;
         config::compaction_batch_size = -1;
         config::inverted_index_compaction_enable = false;
+        config::enable_segcompaction = true;
+        config::enable_ordered_data_compaction = true;
+        config::total_permits_for_compaction_score = 1000000;
+        config::inverted_index_ram_dir_enable = true;
+        config::string_type_length_soft_limit_bytes = 1048576;
     }
 
     IndexCompactionTest() = default;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to