Skip to content
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

(6.1) Fix the issue that primary pessimistic lock may be left not cleared after GC (#866) #867

Conversation

MyonKeminta
Copy link
Contributor

@MyonKeminta MyonKeminta commented Jul 4, 2023

Cherry-picks #866 to tidb-6.1 branch
Ref pingcap/tidb#45134

The problem is that BatchResolveLock calls resolvePessimsticLock without calling getTxnStatus, but resolvePessimsticLock assumes getTxnStatus (in which CheckTxnStatus RPC is called) is done so it doesn't do anything to primary pessimistic lock. This may result in residue pessimistic locks in some rare cases.

This PR moves resolvePessimsticLock calling to after getTxnStatus to avoid the problem.

…fter GC

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@cfzjywxk cfzjywxk merged commit 34f99fa into tikv:tidb-6.1 Jul 4, 2023
@MyonKeminta MyonKeminta deleted the m/fix-batch-resolve-lock-miss-primary-pessimistic-lock-6.1 branch July 4, 2023 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants