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): support database checkpoint isolation #19173

Merged
merged 7 commits into from
Nov 11, 2024

Conversation

wenym1
Copy link
Contributor

@wenym1 wenym1 commented Oct 29, 2024

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

What's changed and what's your intention?

In this PR, we support checkpoint isolation between different databases.

Previously, in global barrier worker in meta node, we have a struct CheckpointControl to manage the barrier state of the whole global streaming graph. To support checkpoint isolation between different databases, the global streaming graph will be divided into per-database streaming graph. The previous CheckpointControl is renamed to DatabaseCheckpointControl, which tracks the barrier state of the streaming graph of the database. In recovery, we will divide the runtime information for different databases.

Each database will have its own streaming graph that independently injects and collects barrier. The partial_graph_id in StreamingControlRequest is changed from u32 to u64. Previously, the partial graph id is the u32 job id for creating snapshot backfill jobs, and u32::MAX for the global streaming graph. In this PR, the u64 partial graph id will be composed from database id and job id. The high 32 bits will store the database id, and the low 32 bits will store the job id (for the partial graph of created jobs, it's u32::MAX).

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.

Base automatically changed from yiming/single-database-command to main November 1, 2024 10:25
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!

Copy link
Contributor

@kwannoel kwannoel 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.

@wenym1
Copy link
Contributor Author

wenym1 commented Nov 8, 2024

Just had a test locally. I created a separate database, and create a blackhole sink that will sleep for 1s in every barrier to mock the scenario of slowness. In the original database, the e2e test can be run successfully without being blocked by the slowness, which tentatively proves the functionality of database checkpoint isolation.

Will add more tests in later PR.

@wenym1 wenym1 added this pull request to the merge queue Nov 8, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 8, 2024
@wenym1 wenym1 enabled auto-merge November 8, 2024 10:05
@wenym1 wenym1 added this pull request to the merge queue Nov 11, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 11, 2024
@graphite-app graphite-app bot requested a review from a team November 11, 2024 07:01
@wenym1 wenym1 added this pull request to the merge queue Nov 11, 2024
Merged via the queue into main with commit 71146a6 Nov 11, 2024
33 of 36 checks passed
@wenym1 wenym1 deleted the yiming/database-checkpoint-isolation branch November 11, 2024 07:40
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.

4 participants