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

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


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 3b9a2b34087 [fix] (compaction) fix time series compaction policy 
(#38915)
3b9a2b34087 is described below

commit 3b9a2b3408771642240b9ff84a27dc2700e49d96
Author: Sun Chenyang <[email protected]>
AuthorDate: Tue Aug 6 14:29:12 2024 +0800

    [fix] (compaction) fix time series compaction policy (#38915)
    
    ## Proposed changes
    
    pick from master #38220
---
 be/src/olap/cumulative_compaction.cpp | 6 ++++--
 be/src/olap/tablet.cpp                | 7 +++++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/be/src/olap/cumulative_compaction.cpp 
b/be/src/olap/cumulative_compaction.cpp
index 4fc3a485083..dbedebc884d 100644
--- a/be/src/olap/cumulative_compaction.cpp
+++ b/be/src/olap/cumulative_compaction.cpp
@@ -82,8 +82,10 @@ Status CumulativeCompaction::execute_compact_impl() {
     _state = CompactionState::SUCCESS;
 
     // 5. set cumulative level
-    
_tablet->cumulative_compaction_policy()->update_compaction_level(_tablet.get(), 
_input_rowsets,
-                                                                     
_output_rowset);
+    if (_tablet->tablet_meta()->time_series_compaction_level_threshold() >= 2) 
{
+        _tablet->cumulative_compaction_policy()->update_compaction_level(
+                _tablet.get(), _input_rowsets, _output_rowset);
+    }
 
     // 6. set cumulative point
     _tablet->cumulative_compaction_policy()->update_cumulative_point(
diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp
index f1eed8b52cd..137bb26c1fb 100644
--- a/be/src/olap/tablet.cpp
+++ b/be/src/olap/tablet.cpp
@@ -1980,8 +1980,11 @@ Status 
Tablet::prepare_compaction_and_calculate_permits(CompactionType compactio
     }
 
     permits = 0;
-    for (auto&& rowset : compaction->input_rowsets()) {
-        permits += rowset->rowset_meta()->get_compaction_score();
+    // Time series policy does not rely on permits, it uses goal size to 
control memory
+    if (tablet->tablet_meta()->compaction_policy() != 
CUMULATIVE_TIME_SERIES_POLICY) {
+        for (auto&& rowset : compaction->input_rowsets()) {
+            permits += rowset->rowset_meta()->get_compaction_score();
+        }
     }
     return Status::OK();
 }


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

Reply via email to