-
Notifications
You must be signed in to change notification settings - Fork 220
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
txnkv: read through locks #380
txnkv: read through locks #380
Conversation
Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
} | ||
|
||
func (lr *LockResolver) resolveLocks(bo *retry.Backoffer, callerStartTS uint64, locks []*Lock, forWrite bool, lite bool) (int64, []uint64 /*pushed*/, error) { |
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.
Without forWrite
flag, it seems the mechanism for conflict of optimistic transactions is missing.
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.
It's handled here #367.
Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
c5dba6b
to
a2936f9
Compare
integration_tests/lock_test.go
Outdated
var locks []*txnlock.Lock | ||
|
||
// commitTS < readStartTS | ||
startTS, _ := s.lockKey([]byte("k1"), []byte("v1"), []byte("k11"), []byte("v11"), true, false) |
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.
Is there a test for resolving a committed async-commit lock?
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.
Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
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.
LGTM
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.
LGTM
Signed-off-by: youjiali1995 <zlwgx1023@gmail.com> Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: youjiali1995 zlwgx1023@gmail.com
TiKV supports read-through-lock tikv/tikv#11238. This PR makes use of it:
forWrite
parameter ofresolveLocks
because it's useless(Abort optimistic transaction when prewrite encounters a lock with larger TS #367) and add theforRead
. IfforRead
is true, resolving secondary locks is asynchronous andcommittedLocks
orresolvedLocks
is returned to the user.ClientHelper
passes theresolvedLocks
toContext
to make use of read-through-lock.Should be merged after pingcap/tidb#29898