-
Notifications
You must be signed in to change notification settings - Fork 590
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
fix: deny create MV on shared CDC source #15635
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
@@ -100,6 +101,10 @@ pub trait WithPropertiesExt: Get { | |||
connector.contains("-cdc") | |||
} | |||
|
|||
fn is_shared_cdc_source(&self) -> bool { | |||
self.is_cdc_connector() && CdcTableType::from_properties(self).can_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.
I'm not sure what's the case for non-shared CDC ('citus-cdc'). Will CREATE SOURCE
for it be rejected (and when?)
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.
Actually we cannot distinguish whether it is going to create a share source from properties only. is_shared_cdc_source
should not provided in the trait.
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.
Can you elaborate? This is just extracted from the current implementation in create_source
. What it should be like?
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.
Yeah, because we do this check in create_source
, so the context is to create a Source. But if without this context, we cannot distinguish it. is_shared_cdc_source
in the trait can be called in other place.
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.
Fair enough.
BTW, what are the other cases? When don't we create shared CDC source for mysql-cdc
? (Do you mean CREATE TABLE
directly? Any other cases?)
And the original question: Can we CREATE SOURCE
for citus-cdc
? If not, where is it rejected?
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.
BTW, what are the other cases? When don't we create shared CDC source for mysql-cdc? (Do you mean CREATE TABLE directly? Any other cases?)
CREATE TABLE
directly, no other cases.
And the original question: Can we CREATE SOURCE for citus-cdc? If not, where is it rejected?
We can't. But it seems we didn't ban it in code.
// gated the feature with a session variable
let create_cdc_source_job = if with_properties.is_cdc_connector() {
CdcTableType::from_properties(&with_properties).can_backfill()
} else {
false
};
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 renamed the function to is_backfillable_cdc_connector
. I think there won't be any confusion now.
For BoundSource
, we can call its method is_shared_cdc_source
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 BoundSource, we can call its method is_shared_cdc_source
Seems not true. CREATE TABLE
will also have a Source node.. Let me just call it is_backfillable_cdc_connector
92e20d1
to
9c44201
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.
the impl LGTM may ask @StrikeW whether this approach meets expectation
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!
Merge activity
|
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
fix #13955
Checklist
./risedev check
(or alias,./risedev c
)Documentation
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.