-
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
executor: lock untouched unique keys on update #42713
Conversation
Signed-off-by: zyguan <zhongyangguan@gmail.com>
[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 submitting an approval review. |
sessionctx/variable/session.go
Outdated
// AddUnchangedRowKey adds an unchanged row key in update statement for pessimistic lock. | ||
func (tc *TransactionContext) AddUnchangedRowKey(key []byte) { | ||
// AddUnchangedKeyForLock adds an unchanged key for pessimistic lock. | ||
func (tc *TransactionContext) AddUnchangedKeyForLock(key []byte) { | ||
if tc.unchangedRowKeys == nil { |
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.
The variable name and comments needs to be changed as well.
Signed-off-by: zyguan <zhongyangguan@gmail.com>
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 5bd81fe
|
/retest |
2 similar comments
/retest |
/retest |
What problem does this PR solve?
Issue Number: close #36438
Problem Summary: Only row keys will be locked after updates (without changing handle), which leads to #36438. We tried to solve the issue by #36498, however it has been reverted because of the issue of accumulated locks. Since the optimizition described in tikv/tikv#13694 is done, we can now solve the issue again.
What is changed and how it works?
Also collect untouched unique keys and lock them.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.