-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
session: switch to pessimistic txn mode for autocommit statement retry. #18952
session: switch to pessimistic txn mode for autocommit statement retry. #18952
Conversation
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.
maybe we could force using pessimistic transaction for transaction retry
It's possible that the TiKV is configured to disable pessimistic transactions. |
/run-all-tests |
Codecov Report
@@ Coverage Diff @@
## master #18952 +/- ##
===========================================
Coverage 79.5369% 79.5369%
===========================================
Files 548 548
Lines 149044 149044
===========================================
Hits 118545 118545
Misses 20995 20995
Partials 9504 9504 |
/release |
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
LGTM |
/merge |
Your auto merge job has been accepted, waiting for:
|
/run-all-tests |
/run-cherry-picker |
cherry pick to release-4.0 in PR #19796 |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
What problem does this PR solve?
Optimize high conflicting autocommit DML.
What is changed and how it works?
Autocommit statements always use optimistic transaction mode, but when the conflict rate is high (zipfian distribution), it may retry too many times.
Switch to pessimistic transaction mode for retry can reduce retry cost.
Check List
Tests
benchmark ycsb zipfian workload and compare the result.
There is no error anymore and the performance increased more than 200%.
Release note