tiflow
tiflow copied to clipboard
pkg/causality(cdc): refactor and simplify conflict detector
What problem does this PR solve?
Issue Number: close #10973
What is changed and how it works?
- Remove some useless and redundant logic.
- Move
sortAndDedupHashes
topkg/causality/internal/slots.go
, since it is used to solve the false positive problem caused by hash conflicts in slots. - For
txnEvent
interface, renameGenSortedDedupKeysHash
toConflictKeys
to ensure semantic consistency, because the implementers should not care about internal implementations of conflict_detector.
Check List
Tests
- Unit test
- Integration test
- Manual test (add detailed scripts or steps below)
- No code
Questions
Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?
Release note
Please refer to [Release Notes Language Style Guide](https://pingcap.github.io/tidb-dev-guide/contribute-to-tidb/release-notes-style-guide.html) to write a quality release note.
If you don't think this PR needs a release note then fill it with `None`.
Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please ask for approval from charlescheung96, ensuring that each of them provides their approval before proceeding. For more information see the Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment
/test all
Codecov Report
Attention: Patch coverage is 78.43137%
with 11 lines
in your changes are missing coverage. Please review.
Project coverage is 58.4036%. Comparing base (
cd065d3
) to head (b103f65
). Report is 34 commits behind head on master.
Additional details and impacted files
Components | Coverage Δ | |
---|---|---|
cdc | 63.4049% <78.4313%> (+1.7170%) |
:arrow_up: |
dm | 51.4824% <ø> (+0.2188%) |
:arrow_up: |
engine | 63.4232% <ø> (+0.0635%) |
:arrow_up: |
Flag | Coverage Δ | |
---|---|---|
unit | 58.4036% <78.4313%> (+1.0006%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
@@ Coverage Diff @@
## master #10954 +/- ##
================================================
+ Coverage 57.4030% 58.4036% +1.0006%
================================================
Files 851 853 +2
Lines 125145 127855 +2710
================================================
+ Hits 71837 74672 +2835
+ Misses 47917 47752 -165
- Partials 5391 5431 +40
/test all
/test all
/retest
/retest
We found an out-of-order write problem that could be caused by a conflict detector. /hold until we find the root cause of the problem.
/unhold
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: 3AceShowHand, asddongmen
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [3AceShowHand,asddongmen]
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment
[LGTM Timeline notifier]
Timeline:
-
2024-05-13 03:36:56.006992557 +0000 UTC m=+1451569.764128145
: :ballot_box_with_check: agreed by asddongmen. -
2024-05-15 10:43:05.073179736 +0000 UTC m=+1649938.830315327
: :ballot_box_with_check: agreed by 3AceShowHand.
/retest
In response to a cherrypick label: new pull request created to branch release-6.5
: #11272.
In response to a cherrypick label: new pull request created to branch release-7.1
: #11273.
In response to a cherrypick label: new pull request created to branch release-7.5
: #11274.
In response to a cherrypick label: new pull request created to branch release-8.1
: #11275.
In response to a cherrypick label: new pull request could not be created: failed to create pull request against pingcap/tiflow#release-6.5 from head ti-chi-bot:cherry-pick-10954-to-release-6.5: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for ti-chi-bot:cherry-pick-10954-to-release-6.5."}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#create-a-pull-request"}
In response to a cherrypick label: new pull request could not be created: failed to create pull request against pingcap/tiflow#release-7.1 from head ti-chi-bot:cherry-pick-10954-to-release-7.1: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for ti-chi-bot:cherry-pick-10954-to-release-7.1."}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#create-a-pull-request","status":"422"}
In response to a cherrypick label: new pull request could not be created: failed to create pull request against pingcap/tiflow#release-7.5 from head ti-chi-bot:cherry-pick-10954-to-release-7.5: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for ti-chi-bot:cherry-pick-10954-to-release-7.5."}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#create-a-pull-request"}
In response to a cherrypick label: new pull request could not be created: failed to create pull request against pingcap/tiflow#release-8.1 from head ti-chi-bot:cherry-pick-10954-to-release-8.1: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for ti-chi-bot:cherry-pick-10954-to-release-8.1."}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#create-a-pull-request"}
In response to a cherrypick label: new pull request could not be created: failed to create pull request against pingcap/tiflow#release-6.5 from head ti-chi-bot:cherry-pick-10954-to-release-6.5: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for ti-chi-bot:cherry-pick-10954-to-release-6.5."}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#create-a-pull-request","status":"422"}
In response to a cherrypick label: new pull request could not be created: failed to create pull request against pingcap/tiflow#release-7.1 from head ti-chi-bot:cherry-pick-10954-to-release-7.1: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for ti-chi-bot:cherry-pick-10954-to-release-7.1."}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#create-a-pull-request"}
In response to a cherrypick label: new pull request could not be created: failed to create pull request against pingcap/tiflow#release-7.5 from head ti-chi-bot:cherry-pick-10954-to-release-7.5: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for ti-chi-bot:cherry-pick-10954-to-release-7.5."}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#create-a-pull-request","status":"422"}
In response to a cherrypick label: new pull request could not be created: failed to create pull request against pingcap/tiflow#release-8.1 from head ti-chi-bot:cherry-pick-10954-to-release-8.1: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for ti-chi-bot:cherry-pick-10954-to-release-8.1."}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#create-a-pull-request"}