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

refactor: remove private link related connection #18975

Merged
merged 16 commits into from
Oct 30, 2024

Conversation

tabVersion
Copy link
Contributor

@tabVersion tabVersion commented Oct 17, 2024

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

What's changed and what's your intention?

as title. Deprecate change cloud vendor stuff from kernel

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.

@graphite-app graphite-app bot requested a review from a team October 17, 2024 09:39
@tabVersion tabVersion requested review from fuyufjh and removed request for a team October 17, 2024 09:39
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

license-eye has totally checked 5395 files.

Valid Invalid Ignored Fixed
2289 1 3105 0
Click to see the invalid file list
  • src/meta/service/src/cloud_service.rs

src/meta/service/src/cloud_service.rs Outdated Show resolved Hide resolved
Signed-off-by: tabVersion <[email protected]>

#[async_trait]
impl CloudService for CloudServiceImpl {
async fn rw_cloud_validate_source(
Copy link
Contributor

Choose a reason for hiding this comment

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

This rpc interface is provided to the cloud portal previously, I am not sure whether it is still valid. Please confirm with @cloudcarver @neverchanje
#10139

Copy link
Contributor

Choose a reason for hiding this comment

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

@Gogomoe worked on this previously

Copy link
Contributor Author

@tabVersion tabVersion Oct 21, 2024

Choose a reason for hiding this comment

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

The cloud service is call via cloudagent rpc, according to https://risingwave-labs.slack.com/archives/C03DFGV6L2W/p1729495045551239?thread_ts=1729479931.025979&cid=C03DFGV6L2W.
PingSource func is used in https://github.com/risingwavelabs/risingwave-cloud/blob/main/mgmt/internal/apiservice/controllers/controller_v1/source.go#L124 and https://github.com/risingwavelabs/risingwave-cloud/blob/main/mgmt/internal/apiservice/controllers/controller_v2/sources.go#L160.

But upper level func PostTenantsNsIdSourcesPing and PostTenantTenantIdSourcesPing are not called in the codebase. Seeing them as deprecated.

Will proceed on removing the service.

Will revert the Cloud Service, PingSource is still in use.

@tabVersion tabVersion marked this pull request as draft October 18, 2024 09:04
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

license-eye has totally checked 5395 files.

Valid Invalid Ignored Fixed
2288 2 3105 0
Click to see the invalid file list
  • src/meta/service/src/cloud_service.rs
  • src/meta/src/rpc/ddl_controller_v2.rs

src/frontend/src/handler/create_connection.rs Outdated Show resolved Hide resolved
@@ -26,6 +26,8 @@ pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub connection_id: ConnectionId,
pub name: String,

// todo: Private link service has been deprecated, consider using a new field for the connection info
Copy link
Member

Choose a reason for hiding this comment

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

I think we should deprecate the unnecessary fields in message PrivateLinkService, only keeping the necessary fields for create source.

Copy link
Member

Choose a reason for hiding this comment

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

In long term, the create connection statement should be kept, but the semantic of it is simply storing the user-specific endpoint and targets, instead of calling AWS API to create a private link. This aligns with the style of the connection RFC.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure if it is safe to remove the field. The exisiting connection still need this.
After the cloud portal supports building subnets for private link (long ago), we no longer encourage using create connection for this case.

but the semantic of it is simply storing the user-specific endpoint and targets, instead of calling AWS API to create a private link

IIRC, we store the two fields together with other connector props, rather than in the connection catalog.

Copy link
Member

Choose a reason for hiding this comment

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

IIRC, we store the two fields together with other connector props, rather than in the connection catalog.

I see. Then we may deprecate the entire message PrivateLinkService. See also https://stackoverflow.com/a/52787662/5739882.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does the change involve a new migration, cc @yezizp2012 ?

)));
}
}
if let Some(connection::Info::PrivateLinkService(_)) = &connection.info {
Copy link
Member

Choose a reason for hiding this comment

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

Here is in validate_connection. Will it be called during startup or recovery? If possible, we should allow an existing PrivateLink connection to work after upgrading RW.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will it be called during startup or recovery

Nope. We only call validate_connection when create_source and create_sink, not blocking recovery.

src/meta/service/src/ddl_service.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

license-eye has totally checked 5397 files.

Valid Invalid Ignored Fixed
2289 2 3106 0
Click to see the invalid file list
  • src/meta/service/src/cloud_service.rs
  • src/meta/src/rpc/ddl_controller_v2.rs

Signed-off-by: tabVersion <[email protected]>
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

license-eye has totally checked 5397 files.

Valid Invalid Ignored Fixed
2290 1 3106 0
Click to see the invalid file list
  • src/meta/src/rpc/ddl_controller_v2.rs

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

license-eye has totally checked 5397 files.

Valid Invalid Ignored Fixed
2290 1 3106 0
Click to see the invalid file list
  • src/meta/src/rpc/ddl_controller_v2.rs

Signed-off-by: tabVersion <[email protected]>
Signed-off-by: tabVersion <[email protected]>
Signed-off-by: tabVersion <[email protected]>
@tabVersion tabVersion marked this pull request as ready for review October 22, 2024 08:06
@tabVersion tabVersion requested a review from fuyufjh October 22, 2024 08:06
Signed-off-by: tabVersion <[email protected]>
Signed-off-by: tabVersion <[email protected]>
@graphite-app graphite-app bot requested a review from a team October 23, 2024 09:15
Copy link

gitguardian bot commented Oct 28, 2024

⚠️ GitGuardian has uncovered 3 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
9425213 Triggered Generic Password 635ca5e e2e_test/source_inline/tvf/postgres_query.slt View secret
9425213 Triggered Generic Password 635ca5e e2e_test/source_inline/tvf/postgres_query.slt View secret
9425213 Triggered Generic Password 635ca5e risedev.yml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

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
Member

@xxchan xxchan left a comment

Choose a reason for hiding this comment

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

Should we note this breaking change in release note?

@xxchan
Copy link
Member

xxchan commented Oct 28, 2024

@tabVersion
Copy link
Contributor Author

I think yes, this is documented docs.risingwave.com/docs/current/sql-create-connection#create-an-aws-privatelink-connection

yes, config aws with kernel code is not recommended long ago.

@tabVersion
Copy link
Contributor Author

tested via RisingWave Cloud, PingSource func works as expected.

image image

@tabVersion tabVersion added this pull request to the merge queue Oct 30, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 30, 2024
@tabVersion tabVersion enabled auto-merge October 30, 2024 11:47
@tabVersion tabVersion added this pull request to the merge queue Oct 30, 2024
Merged via the queue into main with commit 07c7bc3 Oct 30, 2024
32 of 33 checks passed
@tabVersion tabVersion deleted the tab/deprecate-private-link-connection branch October 30, 2024 12:23
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