weizuo93 commented on a change in pull request #5592: URL: https://github.com/apache/incubator-doris/pull/5592#discussion_r606230352
########## File path: be/src/olap/olap_server.cpp ########## @@ -386,20 +386,30 @@ void StorageEngine::_compaction_tasks_producer_callback() { std::vector<TabletSharedPtr> StorageEngine::_compaction_tasks_generator( CompactionType compaction_type, std::vector<DataDir*> data_dirs) { std::vector<TabletSharedPtr> tablets_compaction; + uint32_t max_compaction_score = 0; std::random_shuffle(data_dirs.begin(), data_dirs.end()); for (auto data_dir : data_dirs) { std::unique_lock<std::mutex> lock(_tablet_submitted_compaction_mutex); if (_tablet_submitted_compaction[data_dir].size() >= config::compaction_task_num_per_disk) { continue; } if (!data_dir->reach_capacity_limit(0)) { + uint32_t disk_max_score = 0; TabletSharedPtr tablet = _tablet_manager->find_best_tablet_to_compaction( - compaction_type, data_dir, _tablet_submitted_compaction[data_dir]); + compaction_type, data_dir, _tablet_submitted_compaction[data_dir], disk_max_score); if (tablet != nullptr) { tablets_compaction.emplace_back(tablet); + max_compaction_score = disk_max_score > max_compaction_score ? disk_max_score : max_compaction_score; Review comment: OK. ########## File path: be/src/olap/olap_server.cpp ########## @@ -386,20 +386,30 @@ void StorageEngine::_compaction_tasks_producer_callback() { std::vector<TabletSharedPtr> StorageEngine::_compaction_tasks_generator( CompactionType compaction_type, std::vector<DataDir*> data_dirs) { std::vector<TabletSharedPtr> tablets_compaction; + uint32_t max_compaction_score = 0; std::random_shuffle(data_dirs.begin(), data_dirs.end()); for (auto data_dir : data_dirs) { std::unique_lock<std::mutex> lock(_tablet_submitted_compaction_mutex); if (_tablet_submitted_compaction[data_dir].size() >= config::compaction_task_num_per_disk) { continue; } if (!data_dir->reach_capacity_limit(0)) { + uint32_t disk_max_score = 0; TabletSharedPtr tablet = _tablet_manager->find_best_tablet_to_compaction( - compaction_type, data_dir, _tablet_submitted_compaction[data_dir]); + compaction_type, data_dir, _tablet_submitted_compaction[data_dir], disk_max_score); if (tablet != nullptr) { tablets_compaction.emplace_back(tablet); + max_compaction_score = disk_max_score > max_compaction_score ? disk_max_score : max_compaction_score; } } } + if (tablets_compaction.size() > 0) { Review comment: OK. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org