[Fix](table property) Fix table property disable_auto_compaction (#27853)

This commit is contained in:
bobhan1
2023-12-11 20:48:11 +08:00
committed by GitHub
parent cd3d31ba13
commit c4e484916b
2 changed files with 15 additions and 12 deletions

View File

@ -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 {

View File

@ -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());
}