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

feat(meta): commit epoch in separate group delta #18893

Merged
merged 8 commits into from
Oct 18, 2024

Conversation

wenym1
Copy link
Contributor

@wenym1 wenym1 commented Oct 14, 2024

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

What's changed and what's your intention?

In #18886, we changed to generate a new sub level id in apply_version_delta. However, it makes the semantic of field sub_level_id in IntraLevelDelta obscure: it means to generate a new sub level id for delta generated from commit_epoch, but means the target sub level id to insert for delta generated from report_compact_task. In other words, the field is shared by commit_epoch and report_compact_task, but has different semantics under the two sources, which is error-prone.

In this PR, we change to add a separate group delta named NewL0SubLevel, which contains only the new SSTs to insert. In apply_version_delta, for IntraLevelDelta, we change back to still using its sub_level_id, and for NewL0SubLevel, we generate a new sub level id for it.

We also refactor the code of apply_version_delta. Previously we had to call summarize_version_deltas to generate a summary on a list of version deltas, and then apply the summary to the hummock version. This is actually unnecessary. In this PR, we change to apply the list of version deltas one by one.

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.

@wenym1 wenym1 added the ci/run-backwards-compat-tests Run backwards compatibility tests in your PR. label Oct 14, 2024
@wenym1 wenym1 requested review from hzxa21, Li0k and zwang28 October 14, 2024 09:41
sst_slice.iter()
self.newly_added_sst_infos(None)
.map(|sst| {
// TODO: should we instead use sst.sst_id?
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

should be sst_id

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.

if let Some(destroy_group_id) = &group_destroy {
self.levels.remove(destroy_group_id);
if is_l0_changed && let Some(levels) = self.levels.get_mut(compaction_group_id) {
levels.update_l0();
Copy link
Contributor

Choose a reason for hiding this comment

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

I think update_l0 is only need by apply_compact_ssts, because whenever insert_new_sub_level the stats of l0 has already been maintained incrementally.

Copy link

gitguardian bot commented Oct 18, 2024

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
9425213 Triggered Generic Password c01749b ci/scripts/e2e-source-test.sh View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@wenym1 wenym1 enabled auto-merge October 18, 2024 06:01
@wenym1 wenym1 added this pull request to the merge queue Oct 18, 2024
Merged via the queue into main with commit c0d6af1 Oct 18, 2024
31 of 33 checks passed
@wenym1 wenym1 deleted the yiming/separate-commit-epoch-version-delta branch October 18, 2024 06:54
Copy link
Contributor

@Li0k Li0k left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants