yixiutt commented on code in PR #9915: URL: https://github.com/apache/incubator-doris/pull/9915#discussion_r887438098
########## be/src/olap/olap_server.cpp: ########## @@ -304,6 +309,46 @@ void StorageEngine::_tablet_checkpoint_callback(const std::vector<DataDir*>& dat } while (!_stop_background_threads_latch.wait_for(std::chrono::seconds(interval))); } +void StorageEngine::_adjust_compaction_thread_num() { + if (_base_compaction_thread_pool->max_threads() != config::max_base_compaction_threads) { + int old_max_threads = _base_compaction_thread_pool->max_threads(); + Status status = + _base_compaction_thread_pool->set_max_threads(config::max_base_compaction_threads); + if (status.ok()) { + LOG(INFO) << "update base compaction thread pool max_threads from " << old_max_threads + << " to " << config::max_base_compaction_threads; + } + } + if (_base_compaction_thread_pool->min_threads() != config::max_base_compaction_threads) { + int old_min_threads = _base_compaction_thread_pool->min_threads(); + Status status = + _base_compaction_thread_pool->set_min_threads(config::max_base_compaction_threads); + if (status.ok()) { + LOG(INFO) << "update base compaction thread pool min_threads from " << old_min_threads + << " to " << config::max_base_compaction_threads; + } + } + + if (_cumu_compaction_thread_pool->max_threads() != config::max_cumu_compaction_threads) { + int old_max_threads = _cumu_compaction_thread_pool->max_threads(); + Status status = + _cumu_compaction_thread_pool->set_max_threads(config::max_cumu_compaction_threads); + if (status.ok()) { + LOG(INFO) << "update cumu compaction thread pool max_threads from " << old_max_threads Review Comment: ok ########## be/src/olap/olap_server.cpp: ########## @@ -304,6 +309,46 @@ void StorageEngine::_tablet_checkpoint_callback(const std::vector<DataDir*>& dat } while (!_stop_background_threads_latch.wait_for(std::chrono::seconds(interval))); } +void StorageEngine::_adjust_compaction_thread_num() { + if (_base_compaction_thread_pool->max_threads() != config::max_base_compaction_threads) { + int old_max_threads = _base_compaction_thread_pool->max_threads(); + Status status = + _base_compaction_thread_pool->set_max_threads(config::max_base_compaction_threads); + if (status.ok()) { + LOG(INFO) << "update base compaction thread pool max_threads from " << old_max_threads + << " to " << config::max_base_compaction_threads; + } + } + if (_base_compaction_thread_pool->min_threads() != config::max_base_compaction_threads) { + int old_min_threads = _base_compaction_thread_pool->min_threads(); + Status status = + _base_compaction_thread_pool->set_min_threads(config::max_base_compaction_threads); + if (status.ok()) { + LOG(INFO) << "update base compaction thread pool min_threads from " << old_min_threads + << " to " << config::max_base_compaction_threads; + } + } + + if (_cumu_compaction_thread_pool->max_threads() != config::max_cumu_compaction_threads) { + int old_max_threads = _cumu_compaction_thread_pool->max_threads(); + Status status = + _cumu_compaction_thread_pool->set_max_threads(config::max_cumu_compaction_threads); + if (status.ok()) { + LOG(INFO) << "update cumu compaction thread pool max_threads from " << old_max_threads + << " to " << config::max_cumu_compaction_threads; + } + } + if (_cumu_compaction_thread_pool->min_threads() != config::max_cumu_compaction_threads) { + int old_min_threads = _cumu_compaction_thread_pool->min_threads(); + Status status = + _cumu_compaction_thread_pool->set_min_threads(config::max_cumu_compaction_threads); + if (status.ok()) { + LOG(INFO) << "update cumu compaction thread pool min_threads from " << old_min_threads Review Comment: ok -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org