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 cc50d8cd807 [fix](merge-cloud) fix adjustment compaction thread num 
core dump bug (#32962)
cc50d8cd807 is described below

commit cc50d8cd807533e8f180b93c597fc109e8880c74
Author: Luwei <[email protected]>
AuthorDate: Thu Mar 28 17:43:31 2024 +0800

    [fix](merge-cloud) fix adjustment compaction thread num core dump bug 
(#32962)
---
 be/src/cloud/cloud_storage_engine.cpp | 14 ++++++++++++--
 be/src/cloud/cloud_storage_engine.h   |  2 +-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/be/src/cloud/cloud_storage_engine.cpp 
b/be/src/cloud/cloud_storage_engine.cpp
index fd44adbc959..6475412bd86 100644
--- a/be/src/cloud/cloud_storage_engine.cpp
+++ b/be/src/cloud/cloud_storage_engine.cpp
@@ -289,8 +289,14 @@ void CloudStorageEngine::get_cumu_compaction(
     }
 }
 
-void CloudStorageEngine::_adjust_compaction_thread_num() {
+Status CloudStorageEngine::_adjust_compaction_thread_num() {
     int base_thread_num = get_base_thread_num();
+
+    if (!_base_compaction_thread_pool || !_cumu_compaction_thread_pool) {
+        LOG(WARNING) << "base or cumu compaction thread pool is not created";
+        return Status::Error<ErrorCode::INTERNAL_ERROR, false>("");
+    }
+
     if (_base_compaction_thread_pool->max_threads() != base_thread_num) {
         int old_max_threads = _base_compaction_thread_pool->max_threads();
         Status status = 
_base_compaction_thread_pool->set_max_threads(base_thread_num);
@@ -325,6 +331,7 @@ void CloudStorageEngine::_adjust_compaction_thread_num() {
                         << " to " << cumu_thread_num;
         }
     }
+    return Status::OK();
 }
 
 void CloudStorageEngine::_compaction_tasks_producer_callback() {
@@ -345,7 +352,10 @@ void 
CloudStorageEngine::_compaction_tasks_producer_callback() {
     int64_t interval = config::generate_compaction_tasks_interval_ms;
     do {
         if (!config::disable_auto_compaction) {
-            _adjust_compaction_thread_num();
+            Status st = _adjust_compaction_thread_num();
+            if (!st.ok()) {
+                break;
+            }
 
             bool check_score = false;
             int64_t cur_time = UnixMillis();
diff --git a/be/src/cloud/cloud_storage_engine.h 
b/be/src/cloud/cloud_storage_engine.h
index 3dcf2979ecf..d3b3167ca2d 100644
--- a/be/src/cloud/cloud_storage_engine.h
+++ b/be/src/cloud/cloud_storage_engine.h
@@ -94,7 +94,7 @@ private:
     void _compaction_tasks_producer_callback();
     std::vector<CloudTabletSPtr> 
_generate_cloud_compaction_tasks(CompactionType compaction_type,
                                                                   bool 
check_score);
-    void _adjust_compaction_thread_num();
+    Status _adjust_compaction_thread_num();
     Status _submit_base_compaction_task(const CloudTabletSPtr& tablet);
     Status _submit_cumulative_compaction_task(const CloudTabletSPtr& tablet);
     Status _submit_full_compaction_task(const CloudTabletSPtr& tablet);


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

Reply via email to