diff --git a/be/src/olap/olap_server.cpp b/be/src/olap/olap_server.cpp index 736bdaa99304d37..df401ab5864ea45 100644 --- a/be/src/olap/olap_server.cpp +++ b/be/src/olap/olap_server.cpp @@ -1059,9 +1059,6 @@ Status StorageEngine::_submit_compaction_task(TabletSharedPtr tablet, Status st = Tablet::prepare_compaction_and_calculate_permits(compaction_type, tablet, compaction, permits); if (st.ok() && permits > 0) { - if (!force) { - _permit_limiter.request(permits); - } std::unique_ptr& thread_pool = (compaction_type == CompactionType::CUMULATIVE_COMPACTION) ? _cumu_compaction_thread_pool @@ -1074,6 +1071,9 @@ Status StorageEngine::_submit_compaction_task(TabletSharedPtr tablet, << tablet->tablet_id() << "tablet_state=" << tablet->tablet_state(); return; } + if (!force) { + _permit_limiter.request(permits); + } tablet->compaction_stage = CompactionStage::EXECUTING; TEST_SYNC_POINT_RETURN_WITH_VOID("olap_server::execute_compaction"); tablet->execute_compaction(*compaction);