-
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
unistore: Support checking forUpdateTS constraints for prewrite requests of pessimistic transactions #42843
unistore: Support checking forUpdateTS constraints for prewrite requests of pessimistic transactions #42843
Conversation
[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. |
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@MyonKeminta: 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. |
…ite-check-for-update-ts
@@ -817,8 +829,14 @@ func (store *MVCCStore) prewritePessimistic(reqCtx *requestCtx, mutations []*kvr | |||
needConstraintCheck := len(req.PessimisticActions) > 0 && req.PessimisticActions[i] == kvrpcpb.PrewriteRequest_DO_CONSTRAINT_CHECK | |||
lockExists := lock != nil | |||
lockMatch := lockExists && lock.StartTS == startTS | |||
lockConstraintPasses := 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.
How about moving lockConstraintPasses := true
out of the loop?
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.
Looks not necessary, I think? The check is done key-wise just like lockExists
and lockMatch
, and once it fails, the function returns error immediately.
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.
Never mind, just getting used to define global state variable out side loops.
/check-issue-triage-complete |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 1166c3a
|
/retest |
3 similar comments
/retest |
/retest |
/retest |
What problem does this PR solve?
Issue Number: ref #42923 , ref tikv/tikv#14311
Problem Summary:
What is changed and how it works?
This PR added the forUpdateTS check logic as mentioned in tikv/tikv#14311 , for unistore. It's used for running integration tests in tikv/client-go#756
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.