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, frontend): support drop cascade for tables, mviews, views, indexes, sources and sinks #11250

Merged
merged 11 commits into from
Jul 28, 2023

Conversation

chenzl25
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?

  • Resolve feat: Support drop table, index, mview, view, sink and source cascade #11245 feature: dbt for risingwave #7577
  • Use drop_relation to replace drop_table, drop_source, drop_index, drop_sink and drop_source in meta.
  • To support drop cascade, we need to analyze the dependencies between relations. Because relations can depend on each other, we need to drop them in a unified way. We use the breadth-first search method to find dependencies. Once we find out all dependencies, we handle them as usual (e.g. remove them from the etcd. notify frontend. drop streaming job if necessary).
  • Some redundant code between different drop methods could also be reduced in this PR.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • 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 contains user-facing changes.
Click here for Documentation

Types of user-facing changes

Please keep the types that apply to your changes, and remove the others.

  • SQL commands, functions, and operators

Release note

  • Support drop table, index, view, materialized view, source and sink cascade.

@chenzl25 chenzl25 added user-facing-changes Contains changes that are visible to users type/feature labels Jul 26, 2023
@github-actions github-actions bot removed the user-facing-changes Contains changes that are visible to users label Jul 26, 2023
@chenzl25 chenzl25 added the user-facing-changes Contains changes that are visible to users label Jul 26, 2023
@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Merging #11250 (de2b7d2) into main (a7c2334) will increase coverage by 0.03%.
Report is 21 commits behind head on main.
The diff coverage is 31.01%.

@@            Coverage Diff             @@
##             main   #11250      +/-   ##
==========================================
+ Coverage   69.67%   69.71%   +0.03%     
==========================================
  Files        1351     1351              
  Lines      224653   224677      +24     
==========================================
+ Hits       156538   156632      +94     
+ Misses      68115    68045      -70     
Flag Coverage Δ
rust 69.71% <31.01%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
src/frontend/planner_test/src/lib.rs 87.24% <0.00%> (ø)
src/frontend/src/catalog/catalog_service.rs 3.73% <0.00%> (-0.21%) ⬇️
src/frontend/src/handler/drop_source.rs 0.00% <0.00%> (ø)
src/frontend/src/handler/drop_view.rs 0.00% <0.00%> (ø)
src/meta/src/rpc/ddl_controller.rs 0.00% <0.00%> (ø)
src/meta/src/rpc/service/ddl_service.rs 0.00% <0.00%> (ø)
src/rpc_client/src/meta_client.rs 4.21% <0.00%> (-0.03%) ⬇️
src/frontend/src/handler/mod.rs 58.43% <26.31%> (-1.44%) ⬇️
src/frontend/src/test_utils.rs 74.62% <35.41%> (-2.66%) ⬇️
src/meta/src/stream/stream_manager.rs 75.35% <38.46%> (-0.08%) ⬇️
... and 5 more

... and 3 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

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.

LGTM, unifying it made it a lot more maintainable 👍

Copy link
Contributor

@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!

@chenzl25 chenzl25 added this pull request to the merge queue Jul 28, 2023
Merged via the queue into main with commit 2b48dbd Jul 28, 2023
37 of 38 checks passed
@chenzl25 chenzl25 deleted the dylan/support_drop_cascade branch July 28, 2023 08:26
@emile-00 emile-00 added the 📖✓ Covered or will be covered in the user docs. label Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature user-facing-changes Contains changes that are visible to users 📖✓ Covered or will be covered in the user docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Support drop table, index, mview, view, sink and source cascade
4 participants