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

*: try use max uint64 as tso for table/index reader which only has 1 cop task and in autocommit txn #56016

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

crazycs520
Copy link
Contributor

@crazycs520 crazycs520 commented Sep 11, 2024

What problem does this PR solve?

Issue Number: close #56018

Problem Summary: try use max uint64 as tso for table/index reader which only has 1 cop task and in autocommit txn.

What changed and how does it work?

Skip wait tso when table/index reader only has 1 cop task and in auto-commit transaction.

Drawback

This change may break linearizability, so this optimization can only be used when the tidb_guarantee_linearizability is disabled.

Sysbench

  • Prepare
sysbench --config-file=sysbench.conf oltp_point_select --tables=32 --table-size=1000000 --threads=8 prepare
set @@global.tidb_guarantee_linearizability=0;
  • Bench following query:
SELECT id FROM sbtest? WHERE k=?;
Branch Thread QPS Avg Duration(ms) QPS Increased AVG TiDB CPU
Master 16 14603 1.09 700%
This PR 16 19968 0.80 36% 791%
Master 32 27430 1.17 1250%
This PR 32 36514 0.88 33% 1350%
Master 64 35981 1.78 1473%
This PR 64 41723 1.53 16% 1470%
Master 128 37943 3.37 1502%
This PR 128 42674 3.00 12% 1477%

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
@ti-chi-bot ti-chi-bot bot added do-not-merge/invalid-title do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. sig/planner SIG: Planner labels Sep 11, 2024
Copy link

tiprow bot commented Sep 11, 2024

Hi @crazycs520. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@crazycs520 crazycs520 changed the title Index reader try use max uint64 as tso *: try use max uint64 as tso for table/index reader which only has 1 cop task and in autocommit txn Sep 11, 2024
@crazycs520
Copy link
Contributor Author

/retest-required

Copy link

tiprow bot commented Sep 11, 2024

@crazycs520: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest-required

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link

codecov bot commented Sep 11, 2024

Codecov Report

Attention: Patch coverage is 68.68687% with 31 lines in your changes missing coverage. Please review.

Project coverage is 56.0952%. Comparing base (2ea3542) to head (191b62f).
Report is 28 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #56016         +/-   ##
=================================================
- Coverage   72.8732%   56.0952%   -16.7780%     
=================================================
  Files          1605       1737        +132     
  Lines        446555     626547     +179992     
=================================================
+ Hits         325419     351463      +26044     
- Misses       101082     251326     +150244     
- Partials      20054      23758       +3704     
Flag Coverage Δ
integration 37.3522% <30.3030%> (?)
unit 71.9979% <68.6868%> (+0.0077%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.9567% <ø> (ø)
parser ∅ <ø> (∅)
br 51.8864% <ø> (+6.1320%) ⬆️

Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Copy link

ti-chi-bot bot commented Sep 12, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign time-and-fate, windtalker for approval, ensuring that each of them provides their approval before proceeding. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
@crazycs520
Copy link
Contributor Author

/retest-required

Copy link

tiprow bot commented Sep 13, 2024

@crazycs520: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest-required

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

…armup get tso

Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

try use max uint64 as tso for table/index reader which only has 1 cop task and in autocommit txn
1 participant