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

fix(storage): fix the trivial-move loop caused by config and pick_whole_level #17721

Merged
merged 4 commits into from
Jul 17, 2024

Conversation

Li0k
Copy link
Contributor

@Li0k Li0k commented Jul 17, 2024

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

What's changed and what's your intention?

Previously, we stored max_l0_compact_level_count as a config in CompactionConfig, and the default value will change to 0 after upgrading the old cluster.
And max_l0_compact_level_count = 0 would cause the task to be passed over by the validator, which triggered a bug in the pick_whole_level function. pick_whole_level picks out the tasks that contain only one sublevel, which triggers the in-place trivial-move, and the meta gets bogged down.

This PR

  1. Fix the default value of max_l0_compact_level_count
  2. Avoid the task maintaining sublevels less than 2 , picking by pick_whole_level
  3. Deprecate the unreasonable trivial-move judgement and make it stricter.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • 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 MrCroxx and zwang28 July 17, 2024 07:50
@zwang28 zwang28 added the need-cherry-pick-release-1.10 Open a cherry-pick PR to branch release-1.10 after the current PR is merged label Jul 17, 2024
Copy link
Contributor

@zwang28 zwang28 left a comment

Choose a reason for hiding this comment

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

LGTM

self.config.max_l0_compact_level_count as usize,
self.config
.max_l0_compact_level_count
.unwrap_or(compaction_config::max_l0_compact_level_count()) as usize,
Copy link
Contributor

Choose a reason for hiding this comment

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

reminder: compaction_config::max_l0_compact_level_count() makes sense only because it's not configurable in toml config file. Otherwise we should use the value from config file rather than the static default one.

Was the omission of max_l0_compact_level_count from the config file unintentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its not omission, we change the setting of max_l0_compact_level_count to Option and the default value is None (So it's invisible.)

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean it's not included here

@Li0k Li0k enabled auto-merge July 17, 2024 09:20
Copy link
Contributor

@MrCroxx MrCroxx left a comment

Choose a reason for hiding this comment

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

LGTM

@Li0k Li0k added this pull request to the merge queue Jul 17, 2024
Merged via the queue into main with commit 4605773 Jul 17, 2024
32 of 33 checks passed
@Li0k Li0k deleted the li0k/fix_trivial_move_loop branch July 17, 2024 09:34
github-merge-queue bot pushed a commit that referenced this pull request Jul 17, 2024
zwang28 pushed a commit that referenced this pull request Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/run-e2e-single-node-tests need-cherry-pick-release-1.10 Open a cherry-pick PR to branch release-1.10 after the current PR is merged type/fix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants