Skip to content

Conversation

@shanicky
Copy link
Contributor

@shanicky shanicky commented Oct 21, 2025

Introduce a new parallelism_policy field to fragment distribution metadata and propagate it through controller, meta service, and system catalog for improved visibility.

  • Add parallelism_policy to FragmentDistribution in proto
  • Compute and format parallelism policy for each fragment, including overrides and upstream inheritance
  • Propagate new field through meta service and relevant RPCs
  • Expose parallelism_policy in rw_fragments system catalog
  • Enhance debugging and operational insight into fragment parallelism
dev=> SET STREAMING_USE_ARRANGEMENT_BACKFILL = false;
SET_VARIABLE
dev=> create table t(v int);
CREATE_TABLE
dev=> create materialized view m as select * from t;
CREATE_MATERIALIZED_VIEW
dev=> create materialized view m1 as select count(*) from t;
CREATE_MATERIALIZED_VIEW
dev=> select fragment_id, parallelism, parallelism_policy from rw_fragments;
 fragment_id | parallelism |   parallelism_policy
-------------+-------------+------------------------
           1 |          12 | inherit(adaptive)
           2 |          12 | inherit(adaptive)
           3 |          12 | upstream_fragment([1])
           4 |           1 | single
           5 |          12 | upstream_fragment([1])
(5 rows)

dev=> alter fragment 2 set parallelism = 3;
ALTER_FRAGMENT
dev=> select fragment_id, parallelism, parallelism_policy from rw_fragments;
 fragment_id | parallelism |   parallelism_policy
-------------+-------------+------------------------
           1 |          12 | inherit(adaptive)
           2 |           3 | override(fixed(3))
           3 |          12 | upstream_fragment([1])
           4 |           1 | single
           5 |          12 | upstream_fragment([1])
(5 rows)

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

What's changed and what's your intention?

Summary
This PR enriches the fragment metadata by introducing a new field, parallelism_policy, to the streaming fragment system. The parallelism_policy field exposes the underlying logic and reasoning for each fragment’s parallelism configuration, improving transparency and debuggability across the backend, API, and frontend system catalog.

Details

  • Key change 1: Adds a new optional parallelism_policy string field to the FragmentDistribution protobuf schema and propagates it to all relevant Rust structs (FragmentDesc, FragmentDistribution, RwFragment), ensuring consistent metadata exposure throughout the stack.
  • Key change 2: Implements logic in the meta controller to compute and format the parallelism policy for each fragment, taking into account fragment overrides, job-level parallelism, singleton distributions, and upstream dependencies (such as NoShuffle dispatchers).
  • Key change 3: Exposes the computed parallelism_policy field via the frontend system catalog table (rw_fragments), enabling users and tools to query and understand the parallelism configuration and its rationale for every fragment.

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.
  • I have checked the Release Timeline and Currently Supported Versions to determine which release branches I need to cherry-pick this PR into.

Documentation

  • My PR needs documentation updates.
Release note

Introduce a new `parallelism_policy` field to fragment distribution
metadata and propagate it through controller, meta service, and system
catalog for improved visibility.

- Add `parallelism_policy` to `FragmentDistribution` in proto
- Compute and format parallelism policy for each fragment, including
  overrides and upstream inheritance
- Propagate new field through meta service and relevant RPCs
- Expose `parallelism_policy` in `rw_fragments` system catalog
- Enhance debugging and operational insight into fragment parallelism

Signed-off-by: Shanicky Chen <[email protected]>
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.

2 participants