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
sink/mysql: fix txn wg counter is not updated correctly #1524
Conversation
/run-all-tests |
1 similar comment
/run-all-tests |
5113d1e
to
dcafb38
Compare
/run-all-tests |
/run-all-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/run-all-tests |
2 similar comments
/run-all-tests |
/run-all-tests |
/run-all-tests |
/run-all-tests tikv=pr/9872 |
/lgtm |
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by writing |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 2037275
|
/merge |
/run-all-tests |
/run-kafka-tests |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #1556 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.0 in PR #1557 |
What problem does this PR solve?
Fix #1486
What is changed and how it works?
There exist two scenarios that
txnWg
is not updated correctlyflushRows
function,flushRows
returns an error and the routine terminates. There could be txns remained intxnCh
txnCh
and updatetxnWg
, there could be new txns sent totxnCh
.So when the worker exits, fill in thetxnCh
to prevent new txns sent totxnCh
, and update thetxnWg
with correct txn number.*sync.WaitGroup
field inSingleTableTxn
struct.*sync.Waitgroup
fieldThere are two candidate solutions, one is to use txnNum to control, the other one is to introduce the control txn
Check List
Tests
Release note