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

refactor(meta): merge periodic and scheduled barrier and non-async handle barrier #14977

Merged
merged 4 commits into from
Feb 18, 2024

Conversation

wenym1
Copy link
Contributor

@wenym1 wenym1 commented Feb 4, 2024

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

What's changed and what's your intention?

Currently in the select! of global barrier worker loop, we only get notified on newly scheduled barrier, but we only pop the barrier when we call handle_new_barrier. In this PR, we change to merged the logic of periodic barriers and scheduled barriers into a next_barrier method that emits the next barrier, and we pass the new barrier to handle_new_barrier to be handled.

Furthermore, currently in handle_new_barrier, we in place wait for inject_barrier to finish before spawning a task to call collect_barrier. In this PR we change to spawn the task directly to handle both inject_barrier and collect_barrier.

After these changes, the handle_new_barrier method gets non-async and non-blocking.

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.

Copy link

gitguardian bot commented Feb 4, 2024

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
Once a secret has been leaked into a git repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 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.

Our GitHub checks need improvements? Share your feedbacks!

@wenym1 wenym1 force-pushed the yiming/non-async-inject-barrier branch 3 times, most recently from 0a434f1 to 61162e3 Compare February 6, 2024 08:23
@wenym1 wenym1 changed the title feat(meta): maintain snapshot of worker and make inject-barrier non-async in worker loop refactor(meta): merge periodic and scheduled barrier and non-async handle barrier Feb 6, 2024
@wenym1 wenym1 force-pushed the yiming/non-async-inject-barrier branch from 61162e3 to ce28905 Compare February 6, 2024 09:20
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.

src/meta/src/barrier/schedule.rs Outdated Show resolved Hide resolved
Copy link
Member

@yezizp2012 yezizp2012 left a comment

Choose a reason for hiding this comment

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

LGTM!

@wenym1 wenym1 enabled auto-merge February 18, 2024 10:23
@wenym1 wenym1 added this pull request to the merge queue Feb 18, 2024
Merged via the queue into main with commit a256378 Feb 18, 2024
26 of 27 checks passed
@wenym1 wenym1 deleted the yiming/non-async-inject-barrier branch February 18, 2024 10:59
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