Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delayed Writes: fix L0 calc bug #311

Merged
merged 1 commit into from
Dec 25, 2022
Merged
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
4 changes: 2 additions & 2 deletions db/column_family.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1013,15 +1013,15 @@ ColumnFamilyData::CalculateWriteDelayDividerAndMaybeUpdateWriteStallCause(

// L0 files
double l0_divider = 1;
const auto extra_l0_ssts = vstorage->NumLevelFiles(0) -
const auto extra_l0_ssts = vstorage->l0_delay_trigger_count() -
Copy link
Contributor

Choose a reason for hiding this comment

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

it means that you used the incorrect value to calc the write delay , right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think that l0_delay_trigger_count() is used generically which works for universal compaction as well. it worked just as well before but i noticed that l0_delay_trigger_count() is used to count the L0 files before and after that point in the code..

mutable_cf_options.level0_slowdown_writes_trigger;
if (extra_l0_ssts > 0) {
const auto num_L0_steps = mutable_cf_options.level0_stop_writes_trigger -
mutable_cf_options.level0_slowdown_writes_trigger;
assert(num_L0_steps > 0);
// since extra_l0_ssts == num_L0_steps then we're in a stop condition.
assert(extra_l0_ssts < num_L0_steps);
l0_divider = 1 / (1 - (extra_l0_ssts / num_L0_steps));
l0_divider = 1 / (1 - (static_cast<double>(extra_l0_ssts) / num_L0_steps));
}

if (l0_divider > biggest_divider) {
Expand Down