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

dataroaring 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 d7f63667f9b [fix](compaction) fix repeatedly picking tablets with 
disable auto compaction (#35472) (#37472)
d7f63667f9b is described below

commit d7f63667f9b190bc5727be910eeb1f23aef052f8
Author: Luwei <814383...@qq.com>
AuthorDate: Mon Jul 8 19:01:40 2024 +0800

    [fix](compaction) fix repeatedly picking tablets with disable auto 
compaction (#35472) (#37472)
---
 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 7ce25e7016d..9f4a2d1c030 100644
--- a/be/src/olap/olap_server.cpp
+++ b/be/src/olap/olap_server.cpp
@@ -855,17 +855,10 @@ std::vector<TabletSharedPtr> 
StorageEngine::_generate_compaction_tasks(
                             : copied_base_map[data_dir],
                     &disk_max_score, _cumulative_compaction_policies);
             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->full_name()
-                            << " 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 c29ab4a3105..61c7809cf54 100644
--- a/be/src/olap/tablet_manager.cpp
+++ b/be/src/olap/tablet_manager.cpp
@@ -738,6 +738,13 @@ TabletSharedPtr 
TabletManager::find_best_tablet_to_compaction(
     uint32_t compaction_score = 0;
     TabletSharedPtr best_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