-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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: introduce the statement buffer of pessimistic lock cache #43530
txn: introduce the statement buffer of pessimistic lock cache #43530
Conversation
Signed-off-by: ekexium <[email protected]>
[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. |
Skipping CI for Draft Pull Request. |
4f3bcd2
to
078380c
Compare
/test all |
078380c
to
b4dae6e
Compare
/test all |
b4dae6e
to
de40c80
Compare
d8e51c9
to
fd30492
Compare
Signed-off-by: ekexium <[email protected]>
fd30492
to
91441ab
Compare
Signed-off-by: ekexium <[email protected]>
/retest |
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.
rest LGTM
return | ||
} | ||
if tc.pessimisticLockCache == nil { | ||
tc.pessimisticLockCache = make(map[string][]byte) |
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.
tc.pessimisticLockCache = make(map[string][]byte) | |
tc.pessimisticLockCache, tc.CurrentStmtPessimisticLockCache = tc.CurrentStmtPessimisticLockCache, tc.pessimisticLockCache | |
return |
Can we just assign tc.CurrentStmtPessimisticLockCache
to tc.pessimisticLockCache
to avoid reallocate?
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 592eba1
|
In response to a cherrypick label: new pull request created to branch |
CurrentStmtPessimisticLockCache := make(map[string][]byte, len(tc.CurrentStmtPessimisticLockCache)) | ||
maps.Copy(CurrentStmtPessimisticLockCache, tc.CurrentStmtPessimisticLockCache) |
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 map CurrentStmtPessimisticLockCache
is never used? Should put it into TxnCtxNeedToRestore
?
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.
Oh, I think no need to put CurrentStmtPessimisticLockCache
into TxnCtxNeedToRestore
, then we can just remove those 2 line code?
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.
Oh, I think no need to put CurrentStmtPessimisticLockCache into TxnCtxNeedToRestore, then we can just remove those 2 line code?
Yes. It must be a mistake during refactoring.
What problem does this PR solve?
Issue Number: close #43294
Problem Summary:
What is changed and how it works?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.