You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by li...@apache.org on 2019/09/17 06:10:10 UTC

[incubator-doris] branch master updated: Limit the max version to cumulative compaction (#1813)

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

lichaoyong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new dc813e6  Limit the max version to cumulative compaction (#1813)
dc813e6 is described below

commit dc813e6c618e97a5a3d6fdf16a3c6fab08565644
Author: lichaoyong <li...@baidu.com>
AuthorDate: Tue Sep 17 14:10:05 2019 +0800

    Limit the max version to cumulative compaction (#1813)
---
 be/src/common/config.h                | 3 ++-
 be/src/olap/cumulative_compaction.cpp | 8 ++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/be/src/common/config.h b/be/src/common/config.h
index f41ee4e..ce5ac46 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -240,7 +240,8 @@ namespace config {
 
     // cumulative compaction policy: max delta file's size unit:B
     CONF_Int32(cumulative_compaction_check_interval_seconds, "10");
-    CONF_Int64(cumulative_compaction_num_singleton_deltas, "5");
+    CONF_Int64(min_cumulative_compaction_num_singleton_deltas, "5");
+    CONF_Int64(max_cumulative_compaction_num_singleton_deltas, "1000");
     CONF_Int32(cumulative_compaction_num_threads, "1");
     CONF_Int32(cumulative_compaction_num_threads_per_disk, "1");
     CONF_Int64(cumulative_compaction_budgeted_bytes, "104857600");
diff --git a/be/src/olap/cumulative_compaction.cpp b/be/src/olap/cumulative_compaction.cpp
index 35ddb81..6f8510a 100755
--- a/be/src/olap/cumulative_compaction.cpp
+++ b/be/src/olap/cumulative_compaction.cpp
@@ -85,7 +85,7 @@ OLAPStatus CumulativeCompaction::pick_rowsets_to_compact() {
         // So the ultimate singleton rowset is revserved.
         RowsetSharedPtr rowset = candidate_rowsets[i];
         if (_tablet->version_for_delete_predicate(rowset->version())) {
-            if (transient_rowsets.size() > config::cumulative_compaction_num_singleton_deltas) {
+            if (transient_rowsets.size() > config::min_cumulative_compaction_num_singleton_deltas) {
                 _input_rowsets = transient_rowsets;
                 break;
             }
@@ -93,10 +93,14 @@ OLAPStatus CumulativeCompaction::pick_rowsets_to_compact() {
             continue;
         }
 
+        if (transient_rowsets.size() >= config::max_cumulative_compaction_num_singleton_deltas) {
+            // the threshold of files to compacted one time
+            break;
+        }
         transient_rowsets.push_back(rowset); 
     }
 
-    if (transient_rowsets.size() > config::cumulative_compaction_num_singleton_deltas) {
+    if (transient_rowsets.size() > config::min_cumulative_compaction_num_singleton_deltas) {
         _input_rowsets = transient_rowsets;
     }
 		


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