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(mysql-cdc): make server.id in WITH option become optional #13031

Merged
merged 13 commits into from
Oct 26, 2023

Conversation

StrikeW
Copy link
Contributor

@StrikeW StrikeW commented Oct 24, 2023

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

What's changed and what's your intention?

  • Generate the server.id for mysql-cdc connector if user doesn't provide to us

related: #12025

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • 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

MySQL CDC

  • make the server.id option become optional, if user don't provide it we will generate a random id internally.

@tabVersion
Copy link
Contributor

a little confused, this pr does not fix #12025 case that it does not handle a wrong server.id.

@StrikeW
Copy link
Contributor Author

StrikeW commented Oct 25, 2023

a little confused, this pr does not fix #12025 case that it does not handle a wrong server.id.

Sorry for the confusion, this pr should deprecate the server.id option, that is we will generate it internally on behalf users.
see #13031 (comment)

@StrikeW StrikeW changed the title feat(mysql-cdc): make server.id option to be optional feat(mysql-cdc): deprecate server.id WITH option and generate it internally Oct 25, 2023
@StrikeW StrikeW requested a review from a team as a code owner October 26, 2023 02:48
@gitguardian
Copy link

gitguardian bot commented Oct 26, 2023

⚠️ GitGuardian has uncovered 1 secret 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 secret in your pull request
GitGuardian id Secret Commit Filename
7648795 Generic CLI Secret c8f2a13 integration_tests/iceberg-cdc/run_test.sh 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 secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  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.

Our GitHub checks need improvements? Share your feedbacks!

@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Merging #13031 (c305768) into main (b724be7) will decrease coverage by 0.07%.
Report is 10 commits behind head on main.
The diff coverage is 2.77%.

@@            Coverage Diff             @@
##             main   #13031      +/-   ##
==========================================
- Coverage   68.40%   68.33%   -0.07%     
==========================================
  Files        1496     1496              
  Lines      252049   252061      +12     
==========================================
- Hits       172413   172252     -161     
- Misses      79636    79809     +173     
Flag Coverage Δ
rust 68.33% <2.77%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/connector/src/source/base.rs 69.36% <ø> (ø)
src/source/src/connector_source.rs 68.37% <100.00%> (ø)
src/connector/src/source/cdc/source/reader.rs 0.00% <0.00%> (ø)
src/connector/src/macros.rs 48.00% <0.00%> (-2.00%) ⬇️
src/connector/src/source/cdc/mod.rs 13.20% <0.00%> (-2.01%) ⬇️
src/meta/service/src/ddl_service.rs 0.00% <0.00%> (ø)

... and 18 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@StrikeW StrikeW requested review from hzxa21 and tabVersion October 26, 2023 03:24
@StrikeW StrikeW force-pushed the siyuan/mysql-cdc-enhancement branch from 099914b to 4563622 Compare October 26, 2023 03:25
Copy link
Collaborator

@hzxa21 hzxa21 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/service/src/ddl_service.rs Outdated Show resolved Hide resolved
visit_fragment(fragment, |node_body| {
if let NodeBody::Source(source_node) = node_body {
let props = &mut source_node.source_inner.as_mut().unwrap().properties;
props.insert("server.id".to_string(), rand_server_id.to_string());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will this overwrite the user-specified server.id if they set it already?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After consideration, I think we should still allow user to set the ID by their own, so I will revert here back to generate a server.id when it is not provided.
Btw I think it doesn't make sense to check the uniqueness of server.id in the validation, since we cannot lock the server.id to avoid other connector to use it at the time we create a connector. IMO we should provide some ways to improve observability for this run time errors.

@StrikeW StrikeW enabled auto-merge October 26, 2023 08:42
@StrikeW StrikeW added this pull request to the merge queue Oct 26, 2023
Merged via the queue into main with commit b0f266b Oct 26, 2023
6 of 8 checks passed
@StrikeW StrikeW deleted the siyuan/mysql-cdc-enhancement branch October 26, 2023 09:36
@StrikeW StrikeW changed the title feat(mysql-cdc): deprecate server.id WITH option and generate it internally feat(mysql-cdc): make server.id WITH option as optional Oct 26, 2023
@StrikeW StrikeW changed the title feat(mysql-cdc): make server.id WITH option as optional feat(mysql-cdc): make server.id in WITH option become optional Oct 26, 2023
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.

4 participants