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

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


The following commit(s) were added to refs/heads/master by this push:
     new f64b5723da1 [fix](compaction) fix repeatedly picking tablets with 
disable auto compaction (#35472)
f64b5723da1 is described below

commit f64b5723da1df8e4f8d8e98ecbd09d8dda5fbe2d
Author: Luwei <814383...@qq.com>
AuthorDate: Tue May 28 09:25:40 2024 +0800

    [fix](compaction) fix repeatedly picking tablets with disable auto 
compaction (#35472)
---
 be/src/olap/olap_server.cpp    | 13 +++----------
 be/src/olap/tablet_manager.cpp |  7 +++++++
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/be/src/olap/olap_server.cpp b/be/src/olap/olap_server.cpp
index c1e0cd1bacc..6bf3490d471 100644
--- a/be/src/olap/olap_server.cpp
+++ b/be/src/olap/olap_server.cpp
@@ -903,17 +903,10 @@ std::vector<TabletSharedPtr> 
StorageEngine::_generate_compaction_tasks(
                     &disk_max_score, _cumulative_compaction_policies);
             for (const auto& tablet : tablets) {
                 if (tablet != nullptr) {
-                    if 
(!tablet->tablet_meta()->tablet_schema()->disable_auto_compaction()) {
-                        if (need_pick_tablet) {
-                            tablets_compaction.emplace_back(tablet);
-                        }
-                        max_compaction_score = std::max(max_compaction_score, 
disk_max_score);
-                    } else {
-                        LOG_EVERY_N(INFO, 500)
-                                << "Tablet " << tablet->tablet_id()
-                                << " will be ignored by automatic compaction 
tasks since it's "
-                                << "set to disabled automatic compaction.";
+                    if (need_pick_tablet) {
+                        tablets_compaction.emplace_back(tablet);
                     }
+                    max_compaction_score = std::max(max_compaction_score, 
disk_max_score);
                 }
             }
         }
diff --git a/be/src/olap/tablet_manager.cpp b/be/src/olap/tablet_manager.cpp
index ff6536f760d..d4cfb0bc4b2 100644
--- a/be/src/olap/tablet_manager.cpp
+++ b/be/src/olap/tablet_manager.cpp
@@ -730,6 +730,13 @@ std::vector<TabletSharedPtr> 
TabletManager::find_best_tablets_to_compaction(
     TabletSharedPtr best_tablet;
     TabletSharedPtr best_single_compact_tablet;
     auto handler = [&](const TabletSharedPtr& tablet_ptr) {
+        if 
(tablet_ptr->tablet_meta()->tablet_schema()->disable_auto_compaction()) {
+            LOG_EVERY_N(INFO, 500) << "Tablet " << tablet_ptr->tablet_id()
+                                   << " will be ignored by automatic 
compaction tasks since it's "
+                                   << "set to disabled automatic compaction.";
+            return;
+        }
+
         if (config::enable_skip_tablet_compaction &&
             tablet_ptr->should_skip_compaction(compaction_type, 
UnixSeconds())) {
             return;


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

Reply via email to