morningman commented on a change in pull request #2473: Optimize compaction strategy of tablet on BE URL: https://github.com/apache/incubator-doris/pull/2473#discussion_r358212712
########## File path: be/src/olap/cumulative_compaction.cpp ########## @@ -76,17 +76,22 @@ OLAPStatus CumulativeCompaction::pick_rowsets_to_compact() { std::vector<RowsetSharedPtr> transient_rowsets; size_t num_overlapping_segments = 0; + // the last delete version we meet when traversing candidate_rowsets + Version last_delete_version { -1, -1 }; + + // traverse rowsets from begin to penultimate rowset. + // Becuse VersionHash will calculated from chosen rowsets. + // If ultimate singleton rowset is chosen, VersionHash + // will be different from the value recorded in FE. + // So the ultimate singleton rowset is revserved. for (size_t i = 0; i < candidate_rowsets.size() - 1; ++i) { - // VersionHash will calculated from chosen rowsets. - // If ultimate singleton rowset is chosen, VersionHash - // will be different from the value recorded in FE. - // So the ultimate singleton rowset is revserved. RowsetSharedPtr rowset = candidate_rowsets[i]; if (_tablet->version_for_delete_predicate(rowset->version())) { if (num_overlapping_segments >= config::min_cumulative_compaction_num_singleton_deltas) { _input_rowsets = transient_rowsets; break; } + last_delete_version = rowset->version(); Review comment: fixed ---------------------------------------------------------------- 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 With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org