-
Notifications
You must be signed in to change notification settings - Fork 609
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(source): deny unknown fields for WITH
options
#13654
Conversation
Wait, is |
FYI there is an existing effort in |
risingwave/src/frontend/src/handler/create_source.rs Lines 571 to 584 in f92b501
Seemingly those check are for |
The darker side of the story is, source risingwave/src/frontend/src/utils/with_options.rs Lines 235 to 239 in f92b501
|
Yes, there is some misuse of the two, @Rossil2012 is working on that |
Anyway, I can't think of any reasons not to add the validation here, since serde is the last step. 🤔 Regardless of where the config come from, it should finally be a valid defined config. |
Just tested this. If we apply this, a meta node with unknown fields persisted will fail to start. Oh, |
WITH
optionsWITH
options
This comment was marked as resolved.
This comment was marked as resolved.
Since the changes in this PR is very simple and non-invasive, maybe we should wait for other ongoing related refactors to be done first. We can come back to this easily. |
25d69bf
to
eabda4b
Compare
Update: since #13414 updated S3 source options, which has some special handling logic. I'm doing some refactoring before merging this PR. |
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
307f0da
to
5bb84dd
Compare
f41a1ea
to
84d2a91
Compare
9af8ff0
to
da8f4e4
Compare
da8f4e4
to
6173db2
Compare
6173db2
to
e2f5a96
Compare
commit 25d69bf Author: xxchan <[email protected]> Date: Mon Dec 25 20:01:44 2023 +0800 fmt commit e53e7a2 Merge: e49429a 4ad1940 Author: xxchan <[email protected]> Date: Mon Dec 25 20:01:00 2023 +0800 Merge branch 'main' into xxchan/deny commit e49429a Author: xxchan <[email protected]> Date: Sat Dec 16 00:57:56 2023 +0800 clippy commit 60e4117 Merge: 9f976f8 2243a02 Author: xxchan <[email protected]> Date: Fri Dec 15 23:13:11 2023 +0800 Merge branch 'main' into xxchan/deny commit 9f976f8 Author: xxchan <[email protected]> Date: Fri Dec 15 23:12:54 2023 +0800 fix pulsar commit 5df6dc5 Author: xxchan <[email protected]> Date: Fri Dec 15 17:56:37 2023 +0800 fix connection.name commit c2df222 Author: xxchan <[email protected]> Date: Fri Dec 15 17:30:05 2023 +0800 fix test commit 373a0d5 Merge: ec398f2 dffeedd Author: xxchan <[email protected]> Date: Fri Dec 15 16:44:49 2023 +0800 Merge branch 'main' into xxchan/deny commit ec398f2 Author: xxchan <[email protected]> Date: Mon Nov 27 16:26:48 2023 +0800 fix: don't reject invalid options for batch select commit 025eea8 Merge: 84bde5f 45d2df5 Author: xxchan <[email protected]> Date: Mon Nov 27 16:18:17 2023 +0800 Merge remote-tracking branch 'origin/main' into xxchan/deny commit 84bde5f Author: xxchan <[email protected]> Date: Mon Nov 27 16:15:52 2023 +0800 revert deny_unknown_fields on sink. commit 2e39b51 Author: xxchan <[email protected]> Date: Mon Nov 27 16:07:43 2023 +0800 source: soft-fail with a flag to achive backwards compatibility commit 22b8911 Author: xxchan <[email protected]> Date: Mon Nov 27 11:30:26 2023 +0800 fmt commit eede798 Author: xxchan <[email protected]> Date: Mon Nov 27 11:30:06 2023 +0800 add err tests commit 55bb9e5 Author: xxchan <[email protected]> Date: Mon Nov 27 10:58:07 2023 +0800 except cdc and datagen
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
related:
WITH
properties in protobuf #7034I think this is a low-hanging fruit to resolve #9450 (or mitigate). After this change, we are able to reject invalid
WITH
options duringCREATE SOURCE
. The error is created by meta when creating the properties from the rawHashMap
.#7034 may allow us to validate the options even earlier in frontend, but I don't think it's super necessary after this. Correct me if I'm wrong.
Code changes:
unknown_fields: HashMap<String, String>
for each source property struct, and add a flag to decide whether to reject unknown fields when creating them (ConnectorProperties::extract
).true)
when reviewing.serde
work better.Note
All source options are fixed, except cdc and datagen. CDC needs to pass many options directly to debezium. Datagen has very complex config for each data field.
Sinks are not updated, since their code path is different. Leave for next PR.
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.