-
Notifications
You must be signed in to change notification settings - Fork 600
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): make blocking sink default + support background sink #16249
Conversation
aa0f81a
to
572fd3d
Compare
Bump, seems like this PR was forgotten |
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.
Rest LGTM
if *ddl_type == DdlType::Sink && *create_type == CreateType::Background { | ||
// We return the original tracking job immediately. | ||
// This is because sink can be decoupled with backfill progress. | ||
// We don't need to wait for sink to finish backfill. |
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.
Is this path still necessary? Can we now simply treat sinks like materialized views?
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.
I suppose so. But it will require more refactoring of code.
Sink is unique from materialized view in that the output will immediately be visible, since it's external to the stream job.
For materialized views, we have to do something extra, which is to hide the output until backfill is complete.
As such we persist materialized views twice, when they undergo background ddl:
- On initial creation. (mark as
Creating
, i.e. invisible, but recoverable). - After creation succeeds (mark as
Finished
, i.e. visible).
For sink we can immediately mark it as Finished
(i.e. just step 2), we can't do that for MVs.
For Index, we have to also go through the same flow as materialized view. When I support Index
I will also review to see if Sink can be supported likewise and unify more branches of code.
For now I think this is acceptable approach which requires least changes, and with simple concept.
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.
For sink we can immediately mark it as
Finished
(i.e. just step 2), we can't do that for MVs.
This is interesting to realize. 😄
34e7300
to
9b12266
Compare
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Part of #15587
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
This PR contains user-facing-changes to the behaviour of sink creation.
After this PR, we will block until backfill completes.
Before this PR, we will immediately let sink finish creating, once first barrier completes. After this PR, if this is the desired behaviour, set
BACKGROUND_DDL=true
.