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 054ae34b560 [improvement](compaction) reduce tablet skip compaction 
time (#44273) (#44794)
054ae34b560 is described below

commit 054ae34b56051b881a1c7df15593d4982f9fcacc
Author: Luwei <lu...@selectdb.com>
AuthorDate: Fri Dec 6 23:27:49 2024 +0800

    [improvement](compaction) reduce tablet skip compaction time (#44273) 
(#44794)
    
    pick master #44273
    
    The time for tablet skip compaction is 120 seconds, which is too long.
    In the scenario of high-frequency import (mow), it leads to a high
    compaction score. Therefore, reducing the skip time to 10 seconds is
    necessary.
---
 be/src/common/config.cpp | 4 +++-
 be/src/common/config.h   | 1 +
 be/src/olap/tablet.cpp   | 4 ++--
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp
index 3cc4a646520..b525721cfd8 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -416,6 +416,8 @@ DEFINE_mDouble(base_compaction_min_data_ratio, "0.3");
 DEFINE_mInt64(base_compaction_dup_key_max_file_size_mbytes, "1024");
 
 DEFINE_Bool(enable_skip_tablet_compaction, "true");
+DEFINE_mInt32(skip_tablet_compaction_second, "10");
+
 // output rowset of cumulative compaction total disk size exceed this config 
size,
 // this rowset will be given to base compaction, unit is m byte.
 DEFINE_mInt64(compaction_promotion_size_mbytes, "1024");
@@ -451,7 +453,7 @@ DEFINE_mInt32(multi_get_max_threads, "10");
 DEFINE_mInt64(total_permits_for_compaction_score, "10000");
 
 // sleep interval in ms after generated compaction tasks
-DEFINE_mInt32(generate_compaction_tasks_interval_ms, "10");
+DEFINE_mInt32(generate_compaction_tasks_interval_ms, "100");
 
 // sleep interval in second after update replica infos
 DEFINE_mInt32(update_replica_infos_interval_seconds, "60");
diff --git a/be/src/common/config.h b/be/src/common/config.h
index b74830b368e..3431dfa6450 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -468,6 +468,7 @@ DECLARE_mDouble(base_compaction_min_data_ratio);
 DECLARE_mInt64(base_compaction_dup_key_max_file_size_mbytes);
 
 DECLARE_Bool(enable_skip_tablet_compaction);
+DECLARE_mInt32(skip_tablet_compaction_second);
 // output rowset of cumulative compaction total disk size exceed this config 
size,
 // this rowset will be given to base compaction, unit is m byte.
 DECLARE_mInt64(compaction_promotion_size_mbytes);
diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp
index 14d5070018e..4349bfa9b95 100644
--- a/be/src/olap/tablet.cpp
+++ b/be/src/olap/tablet.cpp
@@ -2507,10 +2507,10 @@ void Tablet::set_skip_compaction(bool skip, 
CompactionType compaction_type, int6
 
 bool Tablet::should_skip_compaction(CompactionType compaction_type, int64_t 
now) {
     if (compaction_type == CompactionType::CUMULATIVE_COMPACTION && 
_skip_cumu_compaction &&
-        now < _skip_cumu_compaction_ts + 120) {
+        now < _skip_cumu_compaction_ts + 
config::skip_tablet_compaction_second) {
         return true;
     } else if (compaction_type == CompactionType::BASE_COMPACTION && 
_skip_base_compaction &&
-               now < _skip_base_compaction_ts + 120) {
+               now < _skip_base_compaction_ts + 
config::skip_tablet_compaction_second) {
         return true;
     }
     return false;


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

Reply via email to