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

fix(mysql-cdc): enable heartbeat message to keep the offset up to date with upstream #12868

Merged
merged 6 commits into from
Oct 16, 2023

Conversation

StrikeW
Copy link
Contributor

@StrikeW StrikeW commented Oct 16, 2023

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

What's changed and what's your intention?

Enable Debezium to emit heartbeat message which contains a binlog offset for each heartbeat.interval.ms, so that the persisted source offset can be updated even though the upstream table doesn't have any update for a long time.

Tested locally.

related: #12753

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

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.

@StrikeW StrikeW force-pushed the siyuan/cdc-binlog-retention branch from 921142b to 014b2ab Compare October 16, 2023 09:22
@lmatz lmatz enabled auto-merge October 16, 2023 12:56
@lmatz lmatz added this pull request to the merge queue Oct 16, 2023
@codecov
Copy link

codecov bot commented Oct 16, 2023

Codecov Report

Merging #12868 (2da7790) into main (5d97d60) will increase coverage by 0.11%.
Report is 9 commits behind head on main.
The diff coverage is 89.42%.

@@            Coverage Diff             @@
##             main   #12868      +/-   ##
==========================================
+ Coverage   69.14%   69.25%   +0.11%     
==========================================
  Files        1487     1489       +2     
  Lines      244648   245828    +1180     
==========================================
+ Hits       169150   170246    +1096     
- Misses      75498    75582      +84     
Flag Coverage Δ
rust 69.25% <89.42%> (+0.11%) ⬆️

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

Files Coverage Δ
src/connector/src/lib.rs 52.08% <ø> (ø)
src/connector/src/sink/encoder/json.rs 84.63% <100.00%> (ø)
src/connector/src/sink/mod.rs 62.04% <ø> (+0.72%) ⬆️
src/connector/src/source/external.rs 34.96% <100.00%> (ø)
src/expr/core/src/aggregate/def.rs 69.66% <ø> (ø)
.../frontend/src/optimizer/plan_node/generic/union.rs 100.00% <100.00%> (ø)
.../frontend/src/optimizer/plan_node/logical_union.rs 97.09% <100.00%> (+0.17%) ⬆️
src/stream/src/executor/aggregation/minput.rs 97.53% <100.00%> (ø)
src/common/src/monitor/connection.rs 58.53% <50.00%> (ø)
src/connector/src/sink/encoder/mod.rs 73.68% <95.83%> (+37.96%) ⬆️
... and 17 more

... and 17 files with indirect coverage changes

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

Merged via the queue into main with commit 7c301f3 Oct 16, 2023
6 of 7 checks passed
@lmatz lmatz deleted the siyuan/cdc-binlog-retention branch October 16, 2023 15:57
github-actions bot pushed a commit that referenced this pull request Oct 16, 2023
lmatz pushed a commit that referenced this pull request Oct 17, 2023
@StrikeW StrikeW linked an issue Oct 17, 2023 that may be closed by this pull request
Comment on lines +534 to +536
split_offset_mapping
.entry(msg.split_id)
.or_insert(msg.offset.clone());
Copy link
Member

Choose a reason for hiding this comment

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

I guess this should apply to all kinds of messages that have empty keys and payloads? 🤔

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 expect this patch only affect direct cdc use cases, because I am not sure when it would break other connectors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/fix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CDC source: binlog of upstream mysql may not exist upon recovery
4 participants