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

lock_resolver: support verifying primary for check_txn_status #777

Merged

Conversation

MyonKeminta
Copy link
Contributor

@MyonKeminta MyonKeminta commented Apr 23, 2023

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@MyonKeminta MyonKeminta marked this pull request as ready for review April 26, 2023 06:28
@MyonKeminta
Copy link
Contributor Author

This PR is now reviewable. The integration test failed because the TiKV image is not updated yet and doesn't include the latest change. It should pass tomorrow.

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@@ -448,7 +448,11 @@ func (lr *LockResolver) resolveLocks(bo *retry.Backoffer, opts ResolveLocksOptio
var resolve func(*Lock, bool) (TxnStatus, error)
resolve = func(l *Lock, forceSyncCommit bool) (TxnStatus, error) {
status, err := lr.getTxnStatusFromLock(bo, l, callerStartTS, forceSyncCommit, detail)
if err != nil {

if _, ok := errors.Cause(err).(primaryMismatch); ok && l.LockType == kvrpcpb.Op_PessimisticLock {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could print an ERROR or FATAL log for the l.LockType != kvrpcpb.Op_PessimisticLock path since it's unexpected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add an error here. Actually the error will be returned to TiDB, and TiDB will print it as an unknown error anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that there might be other problem about the primary when fair-locking is used...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MyonKeminta
The check issue for fair lock is recorded in pingcap/tidb#43540, could we merge this first?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MyonKeminta The check issue for fair lock is recorded in pingcap/tidb#43540, could we merge this first?

yes. lets merge it.

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@cfzjywxk
Copy link
Contributor

cfzjywxk commented May 6, 2023

@ekexium @zyguan
PTAL

@cfzjywxk cfzjywxk merged commit 5c324b7 into tikv:master May 8, 2023
10 checks passed
@MyonKeminta MyonKeminta deleted the m/check-txn-status-priamry-mismatch branch May 16, 2023 10:38
iosmanthus added a commit that referenced this pull request May 22, 2023
Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Co-authored-by: disksing <i@disksing.com>
Co-authored-by: MyonKeminta <9948422+MyonKeminta@users.noreply.github.com>
Co-authored-by: Violin <6880156+violin0622@users.noreply.github.com>
Co-authored-by: Smilencer <smityz@qq.com>
Co-authored-by: you06 <you1474600@gmail.com>
Co-authored-by: Hu# <ihusharp@gmail.com>
Co-authored-by: Connor <zbk602423539@gmail.com>
Co-authored-by: zyguan <zhongyangguan@gmail.com>
fix case typo in comment. (#778)
fix goroutine leak (#784)
fix TestRURuntimeStatsCleanUp (#787)
Fix wrong resource group name for some requests (#788)
resolver: support verifying primary for check_txn_status (#777)
resolver: handle pessimistic locks in BatchResolveLocks (#794)
resolved ts  (#793)
ResolveLocks for unistore (#807)
MyonKeminta added a commit to MyonKeminta/client-go that referenced this pull request May 26, 2023
* support verifying primary for check_txn_status

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* update kvproto

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* add more failpoint usages

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* update depencency and fix test

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* Do not skip for unistore; refine logs

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* Address comments

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

---------

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
cfzjywxk pushed a commit that referenced this pull request May 29, 2023
…777) (#819)

* Update dependencies

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* lock_resolver: support verifying primary for check_txn_status (#777)

* support verifying primary for check_txn_status

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* update kvproto

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* add more failpoint usages

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* update depencency and fix test

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* Do not skip for unistore; refine logs

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* Address comments

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

---------

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* Try to trigger unit tests

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* update dependency

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* Revert "Try to trigger unit tests"

This reverts commit 7a6ed8d.

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

* trigger ci

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>

---------

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
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.

None yet

3 participants