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

chore(storage): upgrade write limit #12658

Merged
merged 7 commits into from
Oct 9, 2023
Merged

Conversation

Li0k
Copy link
Contributor

@Li0k Li0k commented Oct 7, 2023

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

We've already lowered the default limit for write limit in #12183, and to prevent older clusters from continuing to use the outdated configuration, we've introduced a new logic to rewrite it in a uniform way.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@Li0k Li0k requested review from hzxa21 and zwang28 October 7, 2023 12:18
@codecov
Copy link

codecov bot commented Oct 8, 2023

Codecov Report

Merging #12658 (c4a2c14) into main (b4f357c) will decrease coverage by 0.02%.
Report is 1 commits behind head on main.
The diff coverage is 41.46%.

@@            Coverage Diff             @@
##             main   #12658      +/-   ##
==========================================
- Coverage   69.31%   69.30%   -0.02%     
==========================================
  Files        1470     1470              
  Lines      241559   241592      +33     
==========================================
- Hits       167443   167441       -2     
- Misses      74116    74151      +35     
Flag Coverage Δ
rust 69.30% <41.46%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...ta/src/hummock/manager/compaction_group_manager.rs 79.04% <60.00%> (-0.05%) ⬇️
src/meta/src/hummock/manager/mod.rs 60.44% <35.48%> (-0.38%) ⬇️

... and 5 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Collaborator

@hzxa21 hzxa21 left a comment

Choose a reason for hiding this comment

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

Rest LGTM

Comment on lines 526 to 559
// We've already lowered the default limit for write limit in PR-12183, and to prevent older clusters from continuing to use the outdated configuration, we've introduced a new logic to rewrite it in a uniform way.
let mut rewrite_cg_ids = vec![];
for (cg_id, compaction_group_config) in &mut configs {
// update write limit
let relaxed_default_write_stop_level_count = 1000;
if compaction_group_config
.compaction_config
.level0_sub_level_compact_level_count
== relaxed_default_write_stop_level_count
{
rewrite_cg_ids.push(*cg_id);
}
}

// update meta store
let result = self
.compaction_group_manager
.write()
.await
.update_compaction_config(
&rewrite_cg_ids,
&[
mutable_config::MutableConfig::Level0StopWriteThresholdSubLevelNumber(
compaction_config::level0_stop_write_threshold_sub_level_number(),
),
],
self.env.meta_store(),
)
.await?;

// update memory
for new_config in result {
configs.insert(new_config.group_id(), new_config);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we log the cg id and the updated config when the rewrite happens?

@Li0k Li0k enabled auto-merge October 9, 2023 05:58
@Li0k Li0k added this pull request to the merge queue Oct 9, 2023
Merged via the queue into main with commit 456f3e9 Oct 9, 2023
6 of 7 checks passed
@Li0k Li0k deleted the li0k/storage_upgrade_write_limit branch October 9, 2023 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants