risingwave icon indicating copy to clipboard operation
risingwave copied to clipboard

feat(frontend): Add Create subscription in frontend

Open xxhZs opened this issue 1 year ago • 1 comments
trafficstars

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

CREATE SUBSCRIPTION s1 FROM aaa WITH (retention = '1D') ;
DROP SUBSCRIPTION xxx;
ALTER SUBSCRIPTION x1 RENAME TO x2 ;
ALTER SUBSCRIPTION x1 OWNER TO user1;
ALTER SUBSCRIPTION x1 SET SCHEMA test_schema;
ALTER SUBSCRIPTION x1 SET PARALLELISM = 2;

in frontend

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 #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.

xxhZs avatar Jan 29 '24 03:01 xxhZs

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
9425213 Triggered Generic Password eacebbe3596faa897f8a84f36b989702217f33a7 ci/scripts/regress-test.sh View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

gitguardian[bot] avatar Feb 26 '24 05:02 gitguardian[bot]

I am a bit concerned with a 2.3K LoC PR with zero test :(

Is it possible to split it into smaller PRs and add some tests (at least e2e tests).

I have added e2e test, including alter, and simple create, drop statements, (ci for correctness testing will be added with the cursor implementation)

xxhZs avatar Feb 29 '24 07:02 xxhZs

I am a bit concerned with a 2.3K LoC PR with zero test :(

Is it possible to split it into smaller PRs and add some tests (at least e2e tests).

+1 for splitting the PR.

The current PR can be split into at least 2 PRs. One for meta part only, which involves adding new metadata model and new meta node rpc, and one for frontend part that handles the SQL and call the meta node rpc. The PRs can be further split if a single PR has more than 1K LOC.

wenym1 avatar Feb 29 '24 08:02 wenym1

I am a bit concerned with a 2.3K LoC PR with zero test :( Is it possible to split it into smaller PRs and add some tests (at least e2e tests).

+1 for splitting the PR.

The current PR can be split into at least 2 PRs. One for meta part only, which involves adding new metadata model and new meta node rpc, and one for frontend part that handles the SQL and call the meta node rpc. The PRs can be further split if a single PR has more than 1K LOC.

okk, I split it meta part is in https://github.com/risingwavelabs/risingwave/pull/15371

xxhZs avatar Feb 29 '24 09:02 xxhZs

After spilit out the meta code. the pr is left with only the frontend code which is slightly more than 1k in addition to the tests, the pr can continue to be reviewed

xxhZs avatar Mar 04 '24 10:03 xxhZs

Left a comment in the previous PR. Might be fixed by the way in this PR. https://github.com/risingwavelabs/risingwave/pull/15371#discussion_r1512182710

wenym1 avatar Mar 05 '24 06:03 wenym1

Could you please test drop cascade for a table if it is used by a subscription?

create table t (..);
create subscription sub from t;
drop table t cascade;

test it, drop table t cascade; will drop sub;

xxhZs avatar Mar 19 '24 07:03 xxhZs

Could you please test drop cascade for a table if it is used by a subscription?

create table t (..);
create subscription sub from t;
drop table t cascade;

test it, drop table t cascade; will drop sub;

I see, no wonder I couldn't find the relevant code in this PR, because it is supported in a previous PR.

chenzl25 avatar Mar 19 '24 09:03 chenzl25