client-java
client-java copied to clipboard
[close #757] Support verifying primary for check_txn_status
What problem does this PR solve?
Issue Number: close #757
Problem Description: TBD
What is changed and how does it work?
https://github.com/tikv/client-go/pull/777
- set VerifyIsPrimary to true for KvCheckTxnStatus RPC in client-java. TiKV will check if the primary lock is actually the primary. If not, it will not resolve the primary lock and throw a primaryMismatch error.
- Judge primaryMismatch for PessimisticLock and resolve this PessimisticLock in client-java.
- As for the primaryMismatch for non-PessimisticLock, TiKV will handle it and it will not happen in the client. If we meet it, just throw an exception.
TODO
- add a test for this PR.
- test if it works with lower version TiKV
Codecov Report
:x: Patch coverage is 38.09524% with 13 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 37.85%. Comparing base (cb26d58) to head (5d8b7b6).
:warning: Report is 6 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #758 +/- ##
============================================
- Coverage 37.93% 37.85% -0.08%
+ Complexity 1613 1609 -4
============================================
Files 278 279 +1
Lines 17517 17536 +19
Branches 1992 1996 +4
============================================
- Hits 6645 6639 -6
- Misses 10208 10225 +17
- Partials 664 672 +8
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.