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

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


The following commit(s) were added to refs/heads/branch-4.2 by this push:
     new 804dbaa9b1b branch-4.2: [improvement](compaction) Disable MOW 
version-count promotion by default #67178 (#69626)
804dbaa9b1b is described below

commit 804dbaa9b1b641bed9a1256e1d14a15434e32293
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Oct 27 09:31:17 2026 +0800

    branch-4.2: [improvement](compaction) Disable MOW version-count promotion 
by default #67178 (#69626)
    
    Cherry-picked from #67178
    
    Co-authored-by: Jamie <[email protected]>
---
 be/src/common/config.cpp                           |  8 ++++----
 be/src/common/config.h                             |  6 +++---
 .../cloud_cumulative_compaction_policy_test.cpp    | 13 ++++++++++++
 .../cumulative_compaction_policy_test.cpp          | 23 ++++++++++++++++++++++
 4 files changed, 43 insertions(+), 7 deletions(-)

diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp
index 8c1c0f62a01..bc35931fc07 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -508,10 +508,10 @@ DEFINE_mDouble(compaction_promotion_ratio, "0.05");
 DEFINE_mInt64(compaction_promotion_min_size_mbytes, "128");
 
 // When output rowset of cumulative compaction total version count 
(end_version - start_version)
-// exceed this config count, the rowset will be moved to base compaction
-// NOTE: this config will work for unique key merge-on-write table only, to 
reduce version count
-// related cost on delete bitmap more effectively.
-DEFINE_mInt64(compaction_promotion_version_count, "1000");
+// exceed this config count, the rowset will be moved to base compaction.
+// NOTE: this config only works for unique key merge-on-write tables. The 
default maximum value
+// disables version-count-based promotion while retaining the option to enable 
it when needed.
+DEFINE_mInt64(compaction_promotion_version_count, "9223372036854775807");
 
 // The lower bound size to do cumulative compaction. When total disk size of 
candidate rowsets is less than
 // this size, size_based policy may not do to cumulative compaction. The unit 
is m byte.
diff --git a/be/src/common/config.h b/be/src/common/config.h
index afb0e6c5802..e9cca29fc25 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -574,9 +574,9 @@ DECLARE_mDouble(compaction_promotion_ratio);
 DECLARE_mInt64(compaction_promotion_min_size_mbytes);
 
 // When output rowset of cumulative compaction total version count 
(end_version - start_version)
-// exceed this config count, the rowset will be moved to base compaction
-// NOTE: this config will work for unique key merge-on-write table only, to 
reduce version count
-// related cost on delete bitmap more effectively.
+// exceed this config count, the rowset will be moved to base compaction.
+// NOTE: this config only works for unique key merge-on-write tables. The 
default maximum value
+// disables version-count-based promotion while retaining the option to enable 
it when needed.
 DECLARE_mInt64(compaction_promotion_version_count);
 
 // The lower bound size to do cumulative compaction. When total disk size of 
candidate rowsets is less than
diff --git a/be/test/cloud/cloud_cumulative_compaction_policy_test.cpp 
b/be/test/cloud/cloud_cumulative_compaction_policy_test.cpp
index 763c41e28d2..239b4041028 100644
--- a/be/test/cloud/cloud_cumulative_compaction_policy_test.cpp
+++ b/be/test/cloud/cloud_cumulative_compaction_policy_test.cpp
@@ -162,6 +162,19 @@ TEST_F(TestCloudSizeBasedCumulativeCompactionPolicy, 
new_cumulative_point) {
     EXPECT_EQ(policy.new_cumulative_point(&_tablet, output_rowset, version, 
2), 6);
 }
 
+TEST_F(TestCloudSizeBasedCumulativeCompactionPolicy,
+       
new_cumulative_point_does_not_promote_small_mow_rowset_with_default_version_limit)
 {
+    CloudTablet tablet(_engine, _tablet_meta);
+    tablet._tablet_meta->_enable_unique_key_merge_on_write = true;
+    tablet._base_size = kGiB;
+
+    CloudSizeBasedCumulativeCompactionPolicy policy;
+    RowsetSharedPtr output_rowset = create_rowset(Version(2, 1003), 1, false, 
kMiB);
+    Version last_delete_version {-1, -1};
+
+    EXPECT_EQ(2, policy.new_cumulative_point(&tablet, output_rowset, 
last_delete_version, 2));
+}
+
 TEST_F(TestCloudSizeBasedCumulativeCompactionPolicy,
        pick_input_rowsets_notready_keeps_latest_versions) {
     auto base_rowset = create_rowset(Version(0, 1), 1, false, 1024 * 1024 * 
1024);
diff --git a/be/test/storage/compaction/cumulative_compaction_policy_test.cpp 
b/be/test/storage/compaction/cumulative_compaction_policy_test.cpp
index 5e2dc1dd265..8d5fb6b0f3a 100644
--- a/be/test/storage/compaction/cumulative_compaction_policy_test.cpp
+++ b/be/test/storage/compaction/cumulative_compaction_policy_test.cpp
@@ -1212,6 +1212,29 @@ TEST_F(TestSizeBasedCumulativeCompactionPolicy,
     EXPECT_EQ(0, compaction_score);
 }
 
+TEST_F(TestSizeBasedCumulativeCompactionPolicy,
+       
update_cumulative_point_does_not_promote_small_mow_rowset_with_default_version_limit)
 {
+    _tablet_meta->set_enable_unique_key_merge_on_write(true);
+    TabletSharedPtr tablet(
+            new Tablet(_engine, _tablet_meta, nullptr, 
CUMULATIVE_SIZE_BASED_POLICY));
+    ASSERT_TRUE(tablet->init().ok());
+    tablet->set_cumulative_layer_point(1);
+    tablet->set_cumulative_promotion_size(64L * kMiB);
+
+    RowsetMetaSharedPtr output_meta(new RowsetMeta());
+    init_rs_meta(output_meta, 1, 1002);
+    output_meta->set_total_disk_size(kMiB);
+    RowsetSharedPtr output_rowset;
+    ASSERT_TRUE(RowsetFactory::create_rowset(nullptr, "", output_meta, 
&output_rowset).ok());
+
+    std::vector<RowsetSharedPtr> input_rowsets;
+    Version last_delete_version {-1, -1};
+    tablet->_cumulative_compaction_policy->update_cumulative_point(
+            tablet.get(), input_rowsets, output_rowset, last_delete_version);
+
+    EXPECT_EQ(1, tablet->cumulative_layer_point());
+}
+
 TEST_F(TestSizeBasedCumulativeCompactionPolicy,
        pick_input_rowsets_large_head_single_overlapping_tail_selected) {
     std::vector<RowsetMetaSharedPtr> rs_metas;


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

Reply via email to