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

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


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 6726c9bf2f8 [improvement](compaction) reduce tablet skip compaction 
time (#44273) (#44791)
6726c9bf2f8 is described below

commit 6726c9bf2f84c308a6b4ce8bbe70ee433c85ba47
Author: Luwei <[email protected]>
AuthorDate: Mon Dec 2 10:07:17 2024 +0800

    [improvement](compaction) reduce tablet skip compaction time (#44273) 
(#44791)
    
    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 e376ab03bfd..4931b61940d 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -424,6 +424,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");
@@ -459,7 +461,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 06f356f5fe8..15e384e7dfb 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -478,6 +478,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 ad8550709a0..5d20ba13c39 100644
--- a/be/src/olap/tablet.cpp
+++ b/be/src/olap/tablet.cpp
@@ -3860,10 +3860,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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to