txnkv: read through locks#380
Merged
Merged
Conversation
Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
you06
reviewed
Nov 19, 2021
you06
reviewed
Nov 19, 2021
you06
reviewed
Nov 19, 2021
| return lr.resolveLocks(bo, callerStartTS, locks, true, lite) | ||
| } | ||
|
|
||
| func (lr *LockResolver) resolveLocks(bo *retry.Backoffer, callerStartTS uint64, locks []*Lock, forWrite bool, lite bool) (int64, []uint64 /*pushed*/, error) { |
Contributor
There was a problem hiding this comment.
Without forWrite flag, it seems the mechanism for conflict of optimistic transactions is missing.
you06
reviewed
Nov 26, 2021
sticnarf
reviewed
Nov 30, 2021
Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
c5dba6b to
a2936f9
Compare
sticnarf
reviewed
Nov 30, 2021
| var locks []*txnlock.Lock | ||
|
|
||
| // commitTS < readStartTS | ||
| startTS, _ := s.lockKey([]byte("k1"), []byte("v1"), []byte("k11"), []byte("v11"), true, false) |
Collaborator
There was a problem hiding this comment.
Is there a test for resolving a committed async-commit lock?
Contributor
Author
There was a problem hiding this comment.
Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
MyonKeminta
pushed a commit
to MyonKeminta/client-go
that referenced
this pull request
Dec 13, 2021
Signed-off-by: youjiali1995 <zlwgx1023@gmail.com> Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: youjiali1995 zlwgx1023@gmail.com
TiKV supports read-through-lock tikv/tikv#11238. This PR makes use of it:
forWriteparameter ofresolveLocksbecause it's useless(Abort optimistic transaction when prewrite encounters a lock with larger TS #367) and add theforRead. IfforReadis true, resolving secondary locks is asynchronous andcommittedLocksorresolvedLocksis returned to the user.ClientHelperpasses theresolvedLockstoContextto make use of read-through-lock.Should be merged after pingcap/tidb#29898