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(connector): add SSL support for external cdc postgres connector #15690

Merged
merged 10 commits into from
Mar 28, 2024

Conversation

jetjinser
Copy link
Contributor

@jetjinser jetjinser commented Mar 14, 2024

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

What's changed and what's your intention?

resolve #14646.

Introduce dependency: postgres-openssl: https://docs.rs/postgres-openssl/latest/postgres_openssl/.

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).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • 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)

This PR adds a new option to Postgres CDC source connector, i.e. ssl.mode.

ssl.mode specifies the SSL/TLS encryption level for secure communication with Postgres. Choices include disable, prefer, and require. This field is optional. prefer is used if not specified. require enforces TLS for connection.

As we support ssl, we can also CREATE SOURCE on Neon databases and create multiple tables based on the shared source. See the note at the bottom of the doc https://github.com/risingwavelabs/risingwave-docs/pull/1994.

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.

@jetjinser jetjinser requested a review from a team as a code owner March 14, 2024 09:03
@neverchanje neverchanje requested a review from StrikeW March 15, 2024 03:11
Cargo.lock Show resolved Hide resolved
@xxchan xxchan changed the title feat(connector): add support for external cdc postgres connector feat(connector): add SSL support for external cdc postgres connector Mar 15, 2024
Copy link
Contributor

@StrikeW StrikeW left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, btw have you test the PR can work with Neon?

@jetjinser jetjinser force-pushed the jinser/connector-ssl branch from fe97503 to 46a9074 Compare March 19, 2024 11:33
@jetjinser
Copy link
Contributor Author

@StrikeW Yes, I've tested it, same steps as #14646, and it works.

@StrikeW StrikeW self-requested a review March 22, 2024 03:05
Copy link
Contributor

@StrikeW StrikeW left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@neverchanje neverchanje left a comment

Choose a reason for hiding this comment

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

Thanks. LGTM

@jetjinser jetjinser force-pushed the jinser/connector-ssl branch from 3b7f71f to 749e38c Compare March 22, 2024 08:00
@neverchanje neverchanje added user-facing-changes Contains changes that are visible to users and removed user-facing-changes Contains changes that are visible to users labels Mar 22, 2024
@jetjinser jetjinser force-pushed the jinser/connector-ssl branch from 6b2e163 to 53a0290 Compare March 26, 2024 17:14
@jetjinser jetjinser requested a review from neverchanje March 26, 2024 18:59
@jetjinser jetjinser enabled auto-merge March 27, 2024 08:13
@StrikeW StrikeW requested a review from stdrc March 28, 2024 07:20
@StrikeW
Copy link
Contributor

StrikeW commented Mar 28, 2024

PTAL cargo.toml @stdrc @BugenZhao

Copy link
Member

@stdrc stdrc left a comment

Choose a reason for hiding this comment

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

approve on behalf of Cargo-lock

@jetjinser jetjinser added this pull request to the merge queue Mar 28, 2024
Merged via the queue into main with commit dd1249d Mar 28, 2024
28 checks passed
@jetjinser jetjinser deleted the jinser/connector-ssl branch March 28, 2024 08:28
jetjinser added a commit that referenced this pull request Mar 28, 2024

impl Default for SslMode {
fn default() -> Self {
Self::Prefer
Copy link
Contributor

Choose a reason for hiding this comment

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

We should set the default value to Disable which is same as before for backward compatible. Then for upstreams that require TLS, the user should set ssl.mode='require'.

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.

Support SSL connection for Neon postgres cdc backfill
4 participants