-
Notifications
You must be signed in to change notification settings - Fork 544
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(frontend): support background ddl for materialized views #12355
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
One thing non-related to this PR about recovery, as you said in slack channel: "If user does not set background ddl session variable, we don’t persist backfill", if so then we need a way to distinguish between jobs that need to be recovered and jobs that need to be cleaned.
304b262
to
4319c8b
Compare
4319c8b
to
9f08abb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May mark this PR as "user-facing" and write some release notes for the doc team. :)
9f08abb
to
1068125
Compare
457d7f3
to
6d7676a
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Test failure caused by failing to cleanup stream job on failure. Need to clean up the |
Codecov Report
@@ Coverage Diff @@
## main #12355 +/- ##
==========================================
- Coverage 69.76% 69.74% -0.02%
==========================================
Files 1424 1424
Lines 236247 236330 +83
==========================================
+ Hits 164826 164837 +11
- Misses 71421 71493 +72
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Part of #8051
Support running background ddl.
We can support it without persistence first.
I prefer to keep this PR small, and work towards an e2e working background ddl for mviews first. Later we will handle sinks and indexes as well. And separately for persistence: #12167
Implementation details
CreateMaterializedViewRequest
to takebackground_ddl
as a parameter.we spawn the stream job creation task in a tokio thread.
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
You should treat this as an experimental feature. It still requires persistence of background ddl portion to be considered complete, as well as more testing. The release note in #12167 will indicate it.
Users can now set the session variable
BACKGROUND_DDL
to a boolean value. Iftrue
,CREATE MATERIALIZED VIEW
will execute in the background, and users should expect to immediately get the typicalCREATE MATERIALIZED VIEW
back as a response.If
false
,CREATE MATERIALIZED VIEW
will execute as per normal.As an example:
You can use
SHOW JOBS
to monitor its progress:Jobs running in the background can be cancelled:
Eventually
CREATE SINK
andCREATE INDEX
will support this as well.Subsequent PRs for these will include a release note.
Note that if cluster crashes while ddl is still running, it is currently not recoverable. But there's work in progress to support persistence of background ddl.