session: switch to pessimistic txn mode for autocommit statement retry.#18952
Merged
ti-srebot merged 4 commits intopingcap:masterfrom Aug 4, 2020
Merged
session: switch to pessimistic txn mode for autocommit statement retry.#18952ti-srebot merged 4 commits intopingcap:masterfrom
ti-srebot merged 4 commits intopingcap:masterfrom
Conversation
jackysp
reviewed
Aug 3, 2020
Contributor
jackysp
left a comment
There was a problem hiding this comment.
maybe we could force using pessimistic transaction for transaction retry
Member
Author
It's possible that the TiKV is configured to disable pessimistic transactions. |
Member
Author
|
/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 |
Contributor
|
/release |
Contributor
|
LGTM |
ti-srebot
approved these changes
Aug 4, 2020
Member
Author
|
/merge |
Contributor
|
Your auto merge job has been accepted, waiting for:
|
Contributor
|
/run-all-tests |
Member
Author
|
/run-cherry-picker |
Contributor
|
cherry pick to release-4.0 in PR #19796 |
ti-srebot
pushed a commit
to ti-srebot/tidb
that referenced
this pull request
Sep 4, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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