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: introduce alter materialized view set resource group #19831

Open
wants to merge 6 commits into
base: peng/label-schedule
Choose a base branch
from

Conversation

shanicky
Copy link
Contributor

@shanicky shanicky commented Dec 17, 2024

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

What's changed and what's your intention?

Waiting for #19719, #19884

This PR adds support for altering resource groups (only for materialized views).

Since altering resource groups is also a form of rescheduling, I have unified the logic with the previous alter parallelism and changed most of the existing alter logic for parallelism to reschedule streaming jobs, making it more consistent.

This PR still needs some testing, including simulations with madsim.
Currently, the manual invocation of the alter command is working fine.

dev=> create table t(v int);
CREATE_TABLE
dev=> create materialized view m1 as select count(*) from t;
CREATE_MATERIALIZED_VIEW
dev=> create materialized view m2 as select * from m1;
CREATE_MATERIALIZED_VIEW
dev=> alter materialized view m1 set resource_group to test;
ERROR:  Failed to run the query

Caused by these errors (recent errors listed first):
  1: gRPC request to meta service failed: Internal error
  2: Cannot resize streaming_job 7 to empty worker set

# add new worker with `test` resource group

dev=> alter materialized view m1 set resource_group to test;
ALTER_MATERIALIZED_VIEW
dev=> alter materialized view m2 set resource_group to test;
ALTER_MATERIALIZED_VIEW
dev=> alter materialized view m1 reset resource_group;
ALTER_MATERIALIZED_VIEW
dev=> alter materialized view m2 reset resource_group;
ALTER_MATERIALIZED_VIEW

Checklist

  • I have written necessary rustdoc comments.

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.

1 participant