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

puller: ignore fallen back resolved ts #2077

Merged
merged 3 commits into from
Jun 18, 2021

Conversation

amyangfei
Copy link
Contributor

@amyangfei amyangfei commented Jun 17, 2021

What problem does this PR solve?

This is an addition fix after #2038

In #2038, kv client tries to send resolved ts to puller after a region information is loaded from PD and dispatched in kv client. However, in extreme scenario, BatchLoadRegionsWithKeyRange could still miss some regions of intermediate states.

What is changed and how it works?

In the #2038 scenario, the fallen back resolved doesn't make any sense, because the resovled-ts in puller only guarantees no late data, but doesn't guarantee no repeated data. We have the same behavior in kv client when processing the resovled ts fallen back from TiKV, ref: https://github.com/pingcap/ticdc/blob/43c40f9d368a5f85beaf05080c3f11135648faa5/cdc/kv/client.go#L1473-L1480

  • late data: It is the first time that a row changed event is received, and its commit-ts is smaller than resolved-ts.
  • repeated data: It is not the first time that a row changed event is received, and its commit-ts is smaller than resolved-ts.

TODO, we should add more tests in span frontier module, and make sure the correctness. Some possible tasks:

  • Support more fine-grained region forward strategy, to avoid non-essential resolved ts fallen back
  • Add more robust and correctness tests for span frontier module

Check List

Tests

  • Unit test
  • Integration test

Release note

  • No release note

@amyangfei amyangfei added needs-cherry-pick-release-4.0 Should cherry pick this PR to release-4.0 branch. needs-cherry-pick-release-5.0 Should cherry pick this PR to release-5.0 branch. needs-cherry-pick-release-5.1 Should cherry pick this PR to release-5.1 branch. labels Jun 17, 2021
@amyangfei amyangfei added this to the v5.1.0 milestone Jun 17, 2021
@ti-chi-bot ti-chi-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 17, 2021
@amyangfei amyangfei added status/ptal Could you please take a look? release-blocker This issue blocks a release. Please solve it ASAP. labels Jun 17, 2021
Copy link
Member

@overvenus overvenus 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 the status/LGT1 Indicates that a PR has LGTM 1. label Jun 17, 2021
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • liuzix
  • overvenus

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 status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 17, 2021
@amyangfei
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: d893599

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 18, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #2077 (3f6453e) into master (0138edc) will increase coverage by 16.0705%.
The diff coverage is 60.8783%.

@@                Coverage Diff                @@
##             master      #2077         +/-   ##
=================================================
+ Coverage   37.8006%   53.8711%   +16.0705%     
=================================================
  Files           110        164         +54     
  Lines         11394      17527       +6133     
=================================================
+ Hits           4307       9442       +5135     
- Misses         6662       7080        +418     
- Partials        425       1005        +580     

@ti-chi-bot ti-chi-bot merged commit 2a59b8a into pingcap:master Jun 18, 2021
@amyangfei amyangfei deleted the disable-puller-panic branch June 18, 2021 03:15
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-4.0 Should cherry pick this PR to release-4.0 branch. needs-cherry-pick-release-5.0 Should cherry pick this PR to release-5.0 branch. needs-cherry-pick-release-5.1 Should cherry pick this PR to release-5.1 branch. release-blocker This issue blocks a release. Please solve it ASAP. size/XS Denotes a PR that changes 0-9 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. status/ptal Could you please take a look?
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants