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: graceful shutdown on meta node & unify election path #17608

Merged
merged 9 commits into from
Jul 10, 2024

Conversation

BugenZhao
Copy link
Member

@BugenZhao BugenZhao commented Jul 8, 2024

Signed-off-by: Bugen Zhao [email protected]I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Follow-up of #17533, based on the ideas proposed in #17351 (comment).

  • Add a "dummy" election client that always claims we are the leader, unifying the code path no matter whether there's HA.
  • Not joining sub-tasks any more, since I've reviewed all of their implementations and found almost all of them are only designed to print a message when exiting (correct me if I'm wrong 🙏).

Still leave some TODOs which requires all components to be ready for graceful shutdown, or whose function signatures will change and then impact code of other components (in order to minimize changes in a single PR).

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

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.

tokio::select! {
_ = svc_shutdown_rx_clone.changed() => return,
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure why we always waited for a change before starting the follower service. Is that essentially a synchronization with the election process to confirm the initial status?

I've removed this line and directly check is_leader(). May need to add it back if that's true.

Copy link
Contributor

@shanicky shanicky left a comment

Choose a reason for hiding this comment

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

election part lgtm

@BugenZhao BugenZhao force-pushed the bz/shutdown-meta-1 branch from 3d20d6b to 869dfcb Compare July 9, 2024 05:09
@BugenZhao BugenZhao changed the title refactor: graceful shutdown on meta node refactor: graceful shutdown on meta node & unify election path Jul 9, 2024
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

Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
Signed-off-by: Bugen Zhao <[email protected]>
@BugenZhao BugenZhao force-pushed the bz/shutdown-meta-1 branch from 955a90d to 8de79d9 Compare July 10, 2024 05:54
@BugenZhao BugenZhao enabled auto-merge July 10, 2024 05:55
@BugenZhao BugenZhao added this pull request to the merge queue Jul 10, 2024
Merged via the queue into main with commit 0987e27 Jul 10, 2024
31 of 32 checks passed
@BugenZhao BugenZhao deleted the bz/shutdown-meta-1 branch July 10, 2024 08:05
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