Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion be/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ namespace config {

// cumulative compaction policy: max delta file's size unit:B
CONF_Int32(cumulative_compaction_check_interval_seconds, "10");
CONF_Int64(cumulative_compaction_num_singleton_deltas, "5");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does base compaction have this problem?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem. It will not accumulate so much cumulative versions.

CONF_Int64(min_cumulative_compaction_num_singleton_deltas, "5");
CONF_Int64(max_cumulative_compaction_num_singleton_deltas, "1000");
CONF_Int32(cumulative_compaction_num_threads, "1");
CONF_Int32(cumulative_compaction_num_threads_per_disk, "1");
CONF_Int64(cumulative_compaction_budgeted_bytes, "104857600");
Expand Down
8 changes: 6 additions & 2 deletions be/src/olap/cumulative_compaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,22 @@ OLAPStatus CumulativeCompaction::pick_rowsets_to_compact() {
// So the ultimate singleton rowset is revserved.
RowsetSharedPtr rowset = candidate_rowsets[i];
if (_tablet->version_for_delete_predicate(rowset->version())) {
if (transient_rowsets.size() > config::cumulative_compaction_num_singleton_deltas) {
if (transient_rowsets.size() > config::min_cumulative_compaction_num_singleton_deltas) {
_input_rowsets = transient_rowsets;
break;
}
transient_rowsets.clear();
continue;
}

if (transient_rowsets.size() >= config::max_cumulative_compaction_num_singleton_deltas) {
// the threshold of files to compacted one time
break;
}
transient_rowsets.push_back(rowset);
}

if (transient_rowsets.size() > config::cumulative_compaction_num_singleton_deltas) {
if (transient_rowsets.size() > config::min_cumulative_compaction_num_singleton_deltas) {
_input_rowsets = transient_rowsets;
}

Expand Down