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): let stream manager handle background ddl recovery instead #17400

Closed
wants to merge 8 commits into from

Conversation

kwannoel
Copy link
Contributor

@kwannoel kwannoel commented Jun 21, 2024

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

What's changed and what's your intention?

  1. Let stream manager handle background ddl recovery, so barrier manager doesn't have to maintain recovered stream jobs. That's the role of stream manager.
  2. Move finish_stream_job from DdlController into CatalogManager. This method will take care of committing table catalog. It doesn't make sense to call low level CatalogManager functions inside DdlCatalogManager.

v1 path before:
Screenshot 2024-06-21 at 9 05 32 PM

v1 path after:
Screenshot 2024-06-21 at 9 05 47 PM

v2 path before:
Screenshot 2024-06-21 at 9 06 02 PM

v2 path after:
Screenshot 2024-06-24 at 2 23 10 PM

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.

@kwannoel
Copy link
Contributor Author

kwannoel commented Jun 24, 2024

Btw we could go a step further, and spawn stream manager in a separate thread, to make it "long running".

Then it will have its own event loop and poll shared channels between itself and other managers, like DdlController, Barrier Manager.

But that will add more complexity, and I can't think of a compelling reason to do so, given we can already move logic from barrier manager to stream manager, without having to do so.

One reason would be to let barrier manager asynchronously notify stream manager that some streaming job is finished.
Then we no longer have to send a finish channel.

@kwannoel kwannoel marked this pull request as draft June 24, 2024 08:23
@kwannoel kwannoel closed this Jul 22, 2024
@kwannoel kwannoel deleted the kwannoel/refactor-finish branch July 22, 2024 05:29
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.

1 participant