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

relay(dm): send one heartbeat for successive skipped GTID #5070

Merged
merged 9 commits into from
Apr 1, 2022

Conversation

lance6716
Copy link
Contributor

@lance6716 lance6716 commented Mar 30, 2022

Signed-off-by: lance6716 [email protected]

What problem does this PR solve?

Issue Number: ref #5063

What is changed and how it works?

see #5063 (comment)

Check List

Tests

  • Integration test
  • Unit tests

Related changes

  • Need to cherry-pick to the release branch

Release note

send one heartbeat for successive skipped GTID when enable relay log

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 30, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • D3Hunter
  • GMHDBJD

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. needs-cherry-pick-release-6.0 Should cherry pick this PR to release-6.0 branch. labels Mar 30, 2022
@lance6716 lance6716 added the area/dm Issues or PRs related to DM. label Mar 30, 2022
@ti-chi-bot ti-chi-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 30, 2022
@lance6716 lance6716 added needs-cherry-pick-release-5.3 Should cherry pick this PR to release-5.3 branch. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 30, 2022
@ti-chi-bot ti-chi-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 30, 2022
@lance6716 lance6716 requested review from D3Hunter and GMHDBJD and removed request for D3Hunter March 30, 2022 08:12
@lance6716
Copy link
Contributor Author

/run-dm-integration-test

@lance6716 lance6716 requested a review from D3Hunter March 30, 2022 08:24
Signed-off-by: lance6716 <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Mar 30, 2022

Codecov Report

Merging #5070 (9669072) into master (687e248) will decrease coverage by 0.0540%.
The diff coverage is 55.5390%.

Flag Coverage Δ
cdc 61.3824% <48.5972%> (+0.7837%) ⬆️
dm 51.8658% <87.5000%> (-0.6038%) ⬇️

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

@@               Coverage Diff                @@
##             master      #5070        +/-   ##
================================================
- Coverage   56.1240%   56.0699%   -0.0541%     
================================================
  Files           522        526         +4     
  Lines         65325      67398      +2073     
================================================
+ Hits          36663      37790      +1127     
- Misses        25094      25891       +797     
- Partials       3568       3717       +149     

@lance6716
Copy link
Contributor Author

/run-dm-integration-test

if state.replaceWithHeartbeat {
// ref https://github.com/pingcap/tiflow/issues/5063#issuecomment-1082678211
// heartbeat period is implemented in LocalStreamer.GetEvent
if state.skipGTID {
switch e.Event.(type) {
// Only replace transaction event
// Other events such as FormatDescriptionEvent, RotateEvent, etc. should be the same as before
case *replication.RowsEvent, *replication.QueryEvent, *replication.GTIDEvent, *replication.XIDEvent, *replication.TableMapEvent:
Copy link
Contributor

Choose a reason for hiding this comment

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

seems we missed *replication.MariadbGTIDEvent

Comment on lines +603 to +607
} else if lastSkipGTID && state.lastSkipGTIDHeader != nil {
// skipGTID is turned off after this event
select {
case s.ch <- event.GenHeartbeatEvent(state.lastSkipGTIDHeader):
case <-ctx.Done():
Copy link
Contributor

Choose a reason for hiding this comment

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

prefer remove this branch, since we don't have strong dependency on heartbeat event and LocalStreamer.GetEvent has simulate normal heartbeat.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mainly to reduce the behaving difference with MySQL, the original purpose is stated in pingcap/dm#1390

Signed-off-by: lance6716 <[email protected]>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 30, 2022
Copy link
Contributor

@Ehco1996 Ehco1996 left a comment

Choose a reason for hiding this comment

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

lgtm

dm/relay/local_reader.go Show resolved Hide resolved
@lance6716
Copy link
Contributor Author

PTAL @GMHDBJD

Copy link
Contributor

@GMHDBJD GMHDBJD left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 31, 2022
@lance6716
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 9669072

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 31, 2022
@lance6716
Copy link
Contributor Author

/run-dm-integration-test

1 similar comment
@lance6716
Copy link
Contributor Author

/run-dm-integration-test

@ti-chi-bot
Copy link
Member

@lance6716: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

Signed-off-by: lance6716 <[email protected]>
@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Apr 1, 2022
@lance6716
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 69c565a

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Apr 1, 2022
@ti-chi-bot ti-chi-bot merged commit 012ee38 into pingcap:master Apr 1, 2022
ti-chi-bot pushed a commit to ti-chi-bot/tiflow that referenced this pull request Apr 1, 2022
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #5092.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #5093.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #5094.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dm Issues or PRs related to DM. needs-cherry-pick-release-5.3 Should cherry pick this PR to release-5.3 branch. needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. needs-cherry-pick-release-6.0 Should cherry pick this PR to release-6.0 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants