Skip to content
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(secret): secret management (part 1) add secret ref protos and referent count in meta catalog #17474

Merged
merged 9 commits into from
Jul 2, 2024

Conversation

yuhao-su
Copy link
Contributor

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

This PR is part 1 of #17456

It will add secret ref protos and referent count in meta catalog and migration.

It only use a default dummy secret_ref in the proto for now.

The secret_ref should be in

  • Catalog
    PbSource and PbSink have their secret_ref from with properties.
    StreamSouceInfo and SinkDesc have their secret_ref from with properties of encode options (mostly used by schema registry).

  • Plan node
    plan nodes should carry secret_refs from along with other properties and they don't need encode options.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

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.

Copy link
Member

@yezizp2012 yezizp2012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM

src/meta/src/controller/streaming_job.rs Outdated Show resolved Hide resolved
proto/catalog.proto Show resolved Hide resolved
@@ -141,6 +144,7 @@ message SinkFormatDesc {
plan_common.EncodeType encode = 2;
map<string, string> options = 3;
optional plan_common.EncodeType key_encode = 4;
map<string, secret.SecretRef> secret_refs = 5;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it duplicate with the pre-defined one in sink proto?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto, not sure about we need to introduce format-encode ones for Sink, cc @xiangjinwu

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sink also uses schema.registry, so I guess it need secrets

src/meta/src/manager/streaming_job.rs Outdated Show resolved Hide resolved
Copy link
Member

@yezizp2012 yezizp2012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, maybe we should give the new fields more clear naming, I can't quickly understand their purpose at first glance.

@yuhao-su
Copy link
Contributor Author

LGTM, maybe we should give the new fields more clear naming, I can't quickly understand their purpose at first glance.

If we know what StreamSourceInfo and SinkFormatDesc are for, while it's true not many have experience in schema registry, it's not really hard to understand the secret_refs in them.

@yuhao-su
Copy link
Contributor Author

@kwannoel Is there any way we can bypass a fuzzy test? It's a big query causing stack overflow https://buildkite.com/risingwavelabs/pull-request/builds/52956#0190608e-9aca-43bb-95f4-1a2933141681

@kwannoel
Copy link
Contributor

@kwannoel Is there any way we can bypass a fuzzy test? It's a big query causing stack overflow https://buildkite.com/risingwavelabs/pull-request/builds/52956#0190608e-9aca-43bb-95f4-1a2933141681

Add skipif madsim to your e2e test

@yuhao-su
Copy link
Contributor Author

@kwannoel Is there any way we can bypass a fuzzy test? It's a big query causing stack overflow https://buildkite.com/risingwavelabs/pull-request/builds/52956#0190608e-9aca-43bb-95f4-1a2933141681

Add skipif madsim to your e2e test

Hmm it's a fuzzy test generated by sqlsmith.

@kwannoel
Copy link
Contributor

kwannoel commented Jun 29, 2024

@kwannoel Is there any way we can bypass a fuzzy test? It's a big query causing stack overflow https://buildkite.com/risingwavelabs/pull-request/builds/52956#0190608e-9aca-43bb-95f4-1a2933141681

Add skipif madsim to your e2e test

Hmm it's a fuzzy test generated by sqlsmith.

In that case it indicates some sort of regression. Because it passes previously.

You can remove the query from sqlsmith query snapshots here: https://github.com/risingwavelabs/sqlsmith-query-snapshots/blob/main/62/queries.sql. Just delete all the lines from https://github.com/risingwavelabs/sqlsmith-query-snapshots/blob/main/62/queries.sql#L40C1-L40C29 onwards. Including L40 itself.

@yuhao-su
Copy link
Contributor Author

yuhao-su commented Jun 29, 2024

In that case it indicates some sort of regression. Because it passes previously.

I see. I asked because I thought it's randomly generated at each run. I'll see what can cause this regression before remove it.

Suprised this can happen consider I only added a few fields in plan node and catalog (and they are currently unused). cc @BugenZhao @st1page

Got this NOTICE: The plan is too deep. Consider simplifying or splitting the query if you encounter any issues.

Copy link
Member

@yezizp2012 yezizp2012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM.

src/meta/src/manager/catalog/utils.rs Outdated Show resolved Hide resolved
src/ctl/src/cmd_impl/meta/migration.rs Outdated Show resolved Hide resolved
@yuhao-su yuhao-su enabled auto-merge July 1, 2024 19:55
@yuhao-su yuhao-su added this pull request to the merge queue Jul 2, 2024
Merged via the queue into main with commit 2dfad37 Jul 2, 2024
31 of 33 checks passed
@yuhao-su yuhao-su deleted the yuhao/add-secret-ref-proto branch July 2, 2024 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants