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

tikv: eliminate unnecessary pessimistic rollback (#12561) #12707

Merged
merged 3 commits into from
Oct 30, 2019

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Oct 15, 2019

cherry-pick #12561 to release-3.0


Signed-off-by: youjiali1995 zlwgx1023@gmail.com

What problem does this PR solve?

When acquiring pessimistic locks fails, we do async pessimistic rollback to clean up all locks even some of them are not locked. These rollback operations will conflict with the following lock operations which may reduce performance.

What is changed and how it works?

If there is only 1 key and lock failed, no need to do pessimistic rollback.

sysbench oltp_write_only, tables: 32*100, threads: 128

Before

SQL statistics:
    queries performed:
        read:                            0
        write:                           28523
        other:                           14900
        total:                           43423
    transactions:                        5859   (47.05 per sec.)
    queries:                             43423  (348.71 per sec.)
    ignored errors:                      3182   (25.55 per sec.)
    reconnects:                          0      (0.00 per sec.)

General statistics:
    total time:                          124.5217s
    total number of events:              5859

Latency (ms):
         min:                                    1.77
         avg:                                 2694.71
         max:                                33254.30
         95th percentile:                     9624.59
         sum:                             15788288.77

This PR

SQL statistics:
    queries performed:
        read:                            0
        write:                           342892
        other:                           179245
        total:                           522137
    transactions:                        70701  (235.34 per sec.)
    queries:                             522137 (1737.99 per sec.)
    ignored errors:                      37843  (125.96 per sec.)
    reconnects:                          0      (0.00 per sec.)

General statistics:
    total time:                          300.4248s
    total number of events:              70701

Latency (ms):
         min:                                    1.88
         avg:                                  543.52
         max:                                 8555.44
         95th percentile:                     1561.52
         sum:                             38427743.18

Check List

Tests

  • No code

Code changes

Side effects

Related changes

  • Need to cherry-pick to the release branch

Release note

  • Improve the performance of the pessimistic transaction in some situations with serious conflicts.

Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>
@sre-bot
Copy link
Contributor Author

sre-bot commented Oct 15, 2019

/run-all-tests

Copy link
Member

@coocood coocood left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@MyonKeminta MyonKeminta left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason zz-jason added status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. labels Oct 30, 2019
@sre-bot
Copy link
Contributor Author

sre-bot commented Oct 30, 2019

Your auto merge job has been accepted, waiting for 13036, 13039, 13031, 12960, 12962, 12900, 12901, 12902, 12708

@sre-bot
Copy link
Contributor Author

sre-bot commented Oct 30, 2019

/run-all-tests

@sre-bot sre-bot merged commit 5cb5162 into pingcap:release-3.0 Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/tikv status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants