Skip to content
Open
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
6 changes: 3 additions & 3 deletions db/compaction/compaction_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -677,13 +677,13 @@ void CompactionJob::GenSubcompactionBoundaries() {
return;
}

uint64_t next_threshold = target_range_size;
uint64_t cut_threshold = 2 * target_range_size / 5 * 4;
uint64_t cumulative_size = 0;
uint64_t num_actual_subcompactions = 1U;
for (TableReader::Anchor& anchor : all_anchors) {
cumulative_size += anchor.range_size;
if (cumulative_size > next_threshold) {
next_threshold += target_range_size;
if (cumulative_size >= cut_threshold) {
cumulative_size = 0;
num_actual_subcompactions++;
boundaries_.push_back(anchor.user_key);
}
Expand Down