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

fix: Fix the panic issue with the parallelism() call #19849

Merged
merged 2 commits into from
Dec 20, 2024

Conversation

shanicky
Copy link
Contributor

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

What's changed and what's your intention?

In theory, only compute nodes should have the concept of parallelism, so invoking parallelism() for other types of workers is meaningless and should not be done.

This pull request renames the original parallelism to compute_parallelism and adds a new parallelism return option to prevent potential misuse.

Checklist

  • I have written necessary rustdoc comments.
  • I have added necessary unit tests and integration tests.
  • I have added test labels as necessary.
  • I have added fuzzing tests or opened an issue to track them.
  • My PR contains breaking changes.
  • My PR changes performance-critical code, so I will run (micro) benchmarks and present the results.
  • My PR contains critical fixes that are necessary to be merged into the latest release.

Documentation

  • My PR needs documentation updates.
Release note

@graphite-app graphite-app bot requested a review from a team December 18, 2024 08:42
Copy link
Member

@xxchan xxchan left a comment

Choose a reason for hiding this comment

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

Thanks for the fix. BTW maybe we can add a test for diagnose?

@@ -221,13 +221,21 @@ impl stream_plan::MaterializeNode {

// Encapsulating the use of parallelism.
impl common::WorkerNode {
pub fn parallelism(&self) -> usize {
pub fn compute_parallelism(&self) -> usize {
Copy link
Member

Choose a reason for hiding this comment

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

Does this new name look like "computing" the parallelism when it's called? What about cn_parallelism or cnode_parallelism?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, I originally wanted to call it streaming_parallelism, but I found that serving node is also using that term. Later, I thought about naming it compute_node_parallelism, but it seems a bit long.

I'll make a change.

…ptional

Signed-off-by: Shanicky Chen <peng@risingwave-labs.com>
@shanicky shanicky force-pushed the peng/parallelism-panic branch from 31f3808 to 8bc9659 Compare December 20, 2024 07:30
@shanicky shanicky enabled auto-merge December 20, 2024 07:30
@shanicky shanicky added this pull request to the merge queue Dec 20, 2024
Merged via the queue into main with commit 709894d Dec 20, 2024
30 of 31 checks passed
@shanicky shanicky deleted the peng/parallelism-panic branch December 20, 2024 08:57
github-actions bot pushed a commit that referenced this pull request Dec 20, 2024
Signed-off-by: Shanicky Chen <peng@risingwave-labs.com>
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