[bugfix](compaction) fix compaction trigger (#14981)
fix bug that when disable_auto_compaction=true but still trigger compaction
This commit is contained in:
@ -726,19 +726,23 @@ void TaskWorkerPool::_publish_version_worker_thread_callback() {
|
||||
.error(status);
|
||||
finish_task_request.__set_error_tablet_ids(error_tablet_ids);
|
||||
} else {
|
||||
for (int i = 0; i < succ_tablet_ids.size(); i++) {
|
||||
TabletSharedPtr tablet =
|
||||
StorageEngine::instance()->tablet_manager()->get_tablet(succ_tablet_ids[i]);
|
||||
if (tablet != nullptr) {
|
||||
tablet->publised_count++;
|
||||
if (tablet->publised_count % 10 == 0) {
|
||||
StorageEngine::instance()->submit_compaction_task(
|
||||
tablet, CompactionType::CUMULATIVE_COMPACTION);
|
||||
LOG(INFO) << "trigger compaction succ, tabletid:" << succ_tablet_ids[i]
|
||||
<< ", publised:" << tablet->publised_count;
|
||||
if (!config::disable_auto_compaction) {
|
||||
for (int i = 0; i < succ_tablet_ids.size(); i++) {
|
||||
TabletSharedPtr tablet =
|
||||
StorageEngine::instance()->tablet_manager()->get_tablet(
|
||||
succ_tablet_ids[i]);
|
||||
if (tablet != nullptr) {
|
||||
tablet->publised_count++;
|
||||
if (tablet->publised_count % 10 == 0) {
|
||||
StorageEngine::instance()->submit_compaction_task(
|
||||
tablet, CompactionType::CUMULATIVE_COMPACTION);
|
||||
LOG(INFO) << "trigger compaction succ, tabletid:" << succ_tablet_ids[i]
|
||||
<< ", publised:" << tablet->publised_count;
|
||||
}
|
||||
} else {
|
||||
LOG(WARNING)
|
||||
<< "trigger compaction failed, tabletid:" << succ_tablet_ids[i];
|
||||
}
|
||||
} else {
|
||||
LOG(WARNING) << "trigger compaction failed, tabletid:" << succ_tablet_ids[i];
|
||||
}
|
||||
}
|
||||
LOG_INFO("successfully publish version")
|
||||
|
||||
@ -111,7 +111,8 @@ Status DeltaWriter::init() {
|
||||
}
|
||||
|
||||
// check tablet version number
|
||||
if (_tablet->exceed_version_limit(config::max_tablet_version_num - 100)) {
|
||||
if (!config::disable_auto_compaction &&
|
||||
_tablet->exceed_version_limit(config::max_tablet_version_num - 100)) {
|
||||
//trigger compaction
|
||||
StorageEngine::instance()->submit_compaction_task(_tablet,
|
||||
CompactionType::CUMULATIVE_COMPACTION);
|
||||
|
||||
@ -281,6 +281,7 @@ Status VerticalMergeIteratorContext::init(const StorageReadOptions& opts) {
|
||||
|
||||
Status VerticalMergeIteratorContext::advance() {
|
||||
// NOTE: we increase _index_in_block directly to valid one check
|
||||
_is_same = false;
|
||||
do {
|
||||
_index_in_block++;
|
||||
if (LIKELY(_index_in_block < _block->rows())) {
|
||||
@ -543,4 +544,4 @@ std::shared_ptr<RowwiseIterator> new_vertical_mask_merge_iterator(
|
||||
}
|
||||
|
||||
} // namespace vectorized
|
||||
} // namespace doris
|
||||
} // namespace doris
|
||||
|
||||
Reference in New Issue
Block a user