diff --git a/be/src/olap/olap_server.cpp b/be/src/olap/olap_server.cpp index b190163c52..97ffc5bc11 100644 --- a/be/src/olap/olap_server.cpp +++ b/be/src/olap/olap_server.cpp @@ -984,7 +984,7 @@ Status StorageEngine::_submit_compaction_task(TabletSharedPtr tablet, ? _cumu_compaction_thread_pool : _base_compaction_thread_pool; auto st = thread_pool->submit_func([tablet, compaction = std::move(compaction), - compaction_type, permits, is_low_priority_task, + compaction_type, permits, force, is_low_priority_task, this]() { if (is_low_priority_task && !_increase_low_priority_task_nums(tablet->data_dir())) { VLOG_DEBUG << "skip low priority compaction task for tablet: " @@ -996,11 +996,15 @@ Status StorageEngine::_submit_compaction_task(TabletSharedPtr tablet, _decrease_low_priority_task_nums(tablet->data_dir()); } } - _permit_limiter.release(permits); + if (!force) { + _permit_limiter.release(permits); + } _pop_tablet_from_submitted_compaction(tablet, compaction_type); }); if (!st.ok()) { - _permit_limiter.release(permits); + if (!force) { + _permit_limiter.release(permits); + } _pop_tablet_from_submitted_compaction(tablet, compaction_type); return Status::InternalError( "failed to submit compaction task to thread pool, "