weizuo93 commented on a change in pull request #5618: URL: https://github.com/apache/incubator-doris/pull/5618#discussion_r612174615
########## File path: be/src/olap/tablet_manager.cpp ########## @@ -693,12 +694,16 @@ TabletSharedPtr TabletManager::find_best_tablet_to_compaction( ReadLock rlock(tablets_shard.lock.get()); for (const auto& tablet_map : tablets_shard.tablet_map) { for (const TabletSharedPtr& tablet_ptr : tablet_map.second.table_arr) { - std::vector<TTabletId>::iterator it_tablet = - find(tablet_submitted_compaction.begin(), tablet_submitted_compaction.end(), - tablet_ptr->tablet_id()); - if (it_tablet != tablet_submitted_compaction.end()) { + std::set<TTabletId>::iterator it_tablet = + (*tablet_submitted_base_compaction).find(tablet_ptr->tablet_id()); + if (it_tablet != (*tablet_submitted_base_compaction).end()) { continue; } + it_tablet = (*tablet_submitted_cumulative_compaction).find(tablet_ptr->tablet_id()); + if (it_tablet != (*tablet_submitted_cumulative_compaction).end()) { + continue; + } + Review comment: > You can use `ContainsKey` in be/src/gutil/map-util.h instead to simplify code. We need to judge whether an element exists in `set`rather than `map`. -- 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