-
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): dependency check for drop function
#19399
Conversation
Binder::included_relations()
to return reference instead of a clonedrop function
162de40
to
8323c2d
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.
Generally LGTM
// TODO: to be removed, pass all objects uniformly through `dependencies` field instead. | ||
pub fn dependent_relations(&self) -> Vec<u32> { |
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.
It seems table.dependent_relations
is not set any more. Will it break sth to call this function?
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.
Oh. The caller uses extend
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 would be in favor of removing this field together now to avoid mistakes. Can put in an upstack PR and merge them together.
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.
It seems
table.dependent_relations
is not set any more. Will it break sth to call this function?
I merged the result of this method and the new dependencies
field to avoid breaking. And now it basically return empty vector for MaterializedView
and Sink
, and remain the same for Table
and Index
.
Since this PR is mainly for drop function
check, I only changed the behavior of MaterializedView
and Sink
. Added TODO comments for the remaining ones.
23e9181
to
42fa721
Compare
@@ -86,6 +86,8 @@ message CreateSinkRequest { | |||
stream_plan.StreamFragmentGraph fragment_graph = 2; | |||
// It is used to provide a replace plan for the downstream table in `create sink into table` requests. | |||
optional ReplaceTablePlan affected_table_change = 3; | |||
// The list of object IDs that this materialized view depends on. | |||
repeated uint32 dependencies = 4; |
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 it accurately direct dependencies? I suppose the meta service can recursively resolve all dependencies.
@@ -104,7 +103,7 @@ impl SinkDesc { | |||
downstream_pk: self.downstream_pk, | |||
distribution_key: self.distribution_key, | |||
owner, | |||
dependent_relations, | |||
dependent_relations: vec![], // TODO(rc): to be deprecated |
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.
Are we going to deprecate all dependent_relations
fields in different catalogs? Are they referenced anywhere?
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 don't think these dependent_relations
fields are used elsewhere except when creating meta objects. cc @yezizp2012 can you confirm?
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.
IIUC that's the only usage when creating meta objects. Previouly the process of detecting dependency cycles for sink into table
relies on it in v1, but that functionality has been transferred to the meta side. However, the code related to this in the FE remains and can be removed for clarity.
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.
FYI, @shanicky will rise a PR to clean that part.
c0592b3
to
5a4b40b
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.
LGTM! Thx for the PR. Please help to unify the behaviors for other relations like index
, source
as well.
Additionally, following this PR, we can provide syntax support for granting and revoking function privileges to enhance user experience.
@@ -241,6 +242,7 @@ impl DdlService for DdlServiceImpl { | |||
fragment_graph, | |||
CreateType::Foreground, | |||
None, | |||
HashSet::new(), // TODO(rc): pass dependencies through this field instead of `PbSource` |
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.
👍 connection and secret are handled in separated fields now and can be unified into dependencies
. This also applies to the connection for the sink.
…a clone Signed-off-by: Richard Chien <[email protected]>
Signed-off-by: Richard Chien <[email protected]>
Signed-off-by: Richard Chien <[email protected]>
Signed-off-by: Richard Chien <[email protected]>
Signed-off-by: Richard Chien <[email protected]>
Signed-off-by: Richard Chien <[email protected]>
Signed-off-by: Richard Chien <[email protected]>
Signed-off-by: Richard Chien <[email protected]>
Signed-off-by: Richard Chien <[email protected]>
Co-authored-by: Bugen Zhao <[email protected]>
Signed-off-by: Richard Chien <[email protected]>
Signed-off-by: Richard Chien <[email protected]>
Signed-off-by: Richard Chien <[email protected]>
5a4b40b
to
502aa21
Compare
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
This PR introduces
dependencies
field inCreateMaterializedViewRequest
andCreateSinkRequest
, and records dependencies upon UDFs uniformly with dependencies upon relations through this field.Fixes #17263.
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.