diff --git a/be/src/agent/task_worker_pool.cpp b/be/src/agent/task_worker_pool.cpp index 5bb3fb8ad7..c9f109560b 100644 --- a/be/src/agent/task_worker_pool.cpp +++ b/be/src/agent/task_worker_pool.cpp @@ -1511,17 +1511,19 @@ void PublishVersionWorkerPool::publish_version_callback(const TAgentTaskRequest& for (auto [tablet_id, _] : succ_tablets) { TabletSharedPtr tablet = _engine.tablet_manager()->get_tablet(tablet_id); if (tablet != nullptr) { - int64_t published_count = - tablet->published_count.fetch_add(1, std::memory_order_relaxed); - if (published_count % 10 == 0) { - auto st = _engine.submit_compaction_task( - tablet, CompactionType::CUMULATIVE_COMPACTION, true); - if (!st.ok()) [[unlikely]] { - LOG(WARNING) << "trigger compaction failed, tablet_id=" << tablet_id - << ", published=" << published_count << " : " << st; - } else { - LOG(INFO) << "trigger compaction succ, tablet_id:" << tablet_id - << ", published:" << published_count; + if (!tablet->tablet_meta()->tablet_schema()->disable_auto_compaction()) { + int64_t published_count = + tablet->published_count.fetch_add(1, std::memory_order_relaxed); + if (published_count % 10 == 0) { + auto st = _engine.submit_compaction_task( + tablet, CompactionType::CUMULATIVE_COMPACTION, true); + if (!st.ok()) [[unlikely]] { + LOG(WARNING) << "trigger compaction failed, tablet_id=" << tablet_id + << ", published=" << published_count << " : " << st; + } else { + LOG(INFO) << "trigger compaction succ, tablet_id:" << tablet_id + << ", published:" << published_count; + } } } } else { diff --git a/be/src/olap/rowset_builder.cpp b/be/src/olap/rowset_builder.cpp index c9da7359a3..5fda708cf4 100644 --- a/be/src/olap/rowset_builder.cpp +++ b/be/src/olap/rowset_builder.cpp @@ -175,7 +175,8 @@ Status RowsetBuilder::init() { RETURN_IF_ERROR(init_mow_context(mow_context)); } - if (!config::disable_auto_compaction) { + if (!config::disable_auto_compaction && + !_tablet->tablet_meta()->tablet_schema()->disable_auto_compaction()) { RETURN_IF_ERROR(check_tablet_version_count()); }