-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
txn: fix some logs and assumptions are inaccurate when the async commit protocol is used #24140
base: master
Are you sure you want to change the base?
Conversation
[REVIEW NOTIFICATION] This pull request has not been approved. 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 |
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
PTAL @cfzjywxk |
store/tikv/commit.go
Outdated
c.mu.Lock() | ||
defer c.mu.Unlock() | ||
// Group that contains primary key is always the first. | ||
// We mark transaction's status committed when we receive the first success response. | ||
c.mu.committed = true |
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.
We may need to mark this field correctly when async commit protocol is used, as the cilent will receive OK
packet when all prewrite requests are successfully processed. Then we may need to adjust the error log messages in L129, the debug log in L137 seems ok.
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.
We may need to mark this field correctly when async commit protocol is used, as the cilent will receive
OK
packet when all prewrite requests are successfully processed. Then we may need to adjust the error log messages in L129, the debug log in L137 seems ok.
I think the twoPhaseCommitter.mu.commited is true means the primary of batchs was commited,so L129 is ok,but in async commit ,the batch mabe not primary,so L137 mabe not accurate
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.
I think we'd better maintain committed
for async commit transactions (setting it in 2pc.go after prewriting finishes).
If we maintain `committed for async commit transactions, then "2PC failed commit key after primary key committed" would be inaccurate.
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.
done
# Conflicts: # store/tikv/commit.go
@zhaoxugang: PR needs rebase. 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 kubernetes/test-infra repository. |
What problem does this PR solve?
Issue Number: close #23542
Problem Summary:
What is changed and how it works?
Proposal: xxx
What's Changed:
How it Works:
Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Side effects
Release note