-
Notifications
You must be signed in to change notification settings - Fork 225
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
Add integration test for the issue that stale pessimistic lock request with force-locking enabled may cause data inconsistency after resolving lock #773
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
Signed-off-by: MyonKeminta <[email protected]>
// Try to make transaction t1 and t2 commit at the same commitTS. | ||
// First, block at finishing getting minCommitTS from PD and before prewriting | ||
s.NoError(failpoint.Enable("tikvclient/beforePrewrite", "pause")) | ||
resCh := make(chan 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.
Is it better to use resCh := make(chan error, 2)
so they two results would not block each other on the result channel?
|
||
// Trigger resolving locks. | ||
// For normal resolve lock procedures, it always uses special path for resolving pessimistic locks, which | ||
// avoids this problem. However, `BatchResolveLock` which is used by GC doesn't have that handling (and |
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.
As discussed maybe we need to fix BatchResolveLock
first and make the resolving behaviour and interface consistent
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.
Yes. I'll try to find some other way to do this test later.
This case actually won't happen, since when we meets pessimistic lock, we always call But perhaps we also need to consider the case that a optimistic lock points to the real primary, but the primary is locked by a stale pessimistic lock pointing to another key which is the invalidated primary... |
Ref: tikv/tikv#14551
This PR adds a integration test case to cover the issue stated in tikv/tikv#14551
It's confirmed that the test will fail when running on older TiKV versions without the fix