Skip to content

distsql: do not change concurrency for keep order request when @@tidb_distsql_scan_concurrency is set - #60803

Merged
ti-chi-bot[bot] merged 1 commit into
pingcap:masterfrom
tiancaiamao:distsql-concurrency
May 16, 2025
Merged

ti-chi-bot[bot] merged 1 commit into
pingcap:masterfrom
tiancaiamao:distsql-concurrency

Conversation

@tiancaiamao

@tiancaiamao tiancaiamao commented Apr 24, 2025 •

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #60891

Problem Summary:

What changed and how does it work?

In #35975, distsql scan concurrency is set to 2 for keep order query.
And later, the PR is partly reset in #55196, concurrency is change to 2 only in limited cases.

It should work most of the times, but in some corner cases the user want better performance and do not care much about the meomry usage, we should have an option for them.
In this PR, if the value of @@tidb_distsql_scan_concurrency is revised, obey that setting.
So when user found a case, he case workaround using hint for that query:

select /*+ set_var(tidb_distsql_scan_concurrency=14)*/ * from t order by id;

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

@ti-chi-bot ti-chi-bot Bot added release-note-none Denotes a PR that doesn't merit a release note. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 24, 2025
@tiprow

tiprow Bot commented Apr 24, 2025

Copy link
Copy Markdown

Hi @tiancaiamao. 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.

Details

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.

@tiancaiamao
tiancaiamao requested review from 0xPoe, XuHuaiyu, bb7133 and cfzjywxk and removed request for 0xPoe and bb7133 April 24, 2025 06:26
@codecov

codecov Bot commented Apr 24, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.0644%. Comparing base (b81a9df) to head (98195dd).
Report is 460 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #60803        +/-   ##
================================================
+ Coverage   73.1201%   76.0644%   +2.9442%     
================================================
  Files          1716       1724         +8     
  Lines        475725     505457     +29732     
================================================
+ Hits         347851     384473     +36622     
+ Misses       106490      99807      -6683     
+ Partials      21384      21177       -207     
Flag Coverage Δ
integration 45.2153% <100.0000%> (?)
unit 75.0655% <100.0000%> (+2.7246%) ⬆️

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

Components Coverage Δ
dumpling 53.0684% <ø> (+0.4130%) ⬆️
parser ∅ <ø> (∅)
br 50.1161% <ø> (+2.7370%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tiancaiamao

Copy link
Copy Markdown
Contributor Author

/test unit-test

@ti-chi-bot

ti-chi-bot Bot commented Apr 24, 2025

Copy link
Copy Markdown

@tiancaiamao: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

/test build
/test check-dev
/test check-dev2
/test mysql-test
/test pull-br-integration-test
/test pull-integration-ddl-test
/test pull-integration-e2e-test
/test pull-lightning-integration-test
/test pull-mysql-client-test
/test pull-unit-test-ddlv1
/test unit-test

The following commands are available to trigger optional jobs:

/test pingcap/tidb/canary_ghpr_unit_test
/test pull-common-test
/test pull-e2e-test
/test pull-integration-common-test
/test pull-integration-copr-test
/test pull-integration-jdbc-test
/test pull-integration-mysql-test
/test pull-integration-nodejs-test
/test pull-integration-python-orm-test
/test pull-scan-deps
/test pull-sqllogic-test
/test pull-tiflash-test

Use /test all to run the following jobs that were automatically triggered:

pingcap/tidb/ghpr_build
pingcap/tidb/ghpr_check
pingcap/tidb/ghpr_check2
pingcap/tidb/ghpr_mysql_test
pingcap/tidb/ghpr_unit_test
pingcap/tidb/pull_integration_ddl_test
pingcap/tidb/pull_integration_e2e_test
pingcap/tidb/pull_mysql_client_test
Details

In response to this:

/test unit-test

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.

@tiprow

tiprow Bot commented Apr 24, 2025

Copy link
Copy Markdown

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

Details

In response to this:

/test unit-test

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.

@tiprow

tiprow Bot commented Apr 24, 2025

Copy link
Copy Markdown

@ti-chi-bot[bot]: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

Details

In response to this:

@tiancaiamao: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

/test build
/test check-dev
/test check-dev2
/test mysql-test
/test pull-br-integration-test
/test pull-integration-ddl-test
/test pull-integration-e2e-test
/test pull-lightning-integration-test
/test pull-mysql-client-test
/test pull-unit-test-ddlv1
/test unit-test

The following commands are available to trigger optional jobs:

/test pingcap/tidb/canary_ghpr_unit_test
/test pull-common-test
/test pull-e2e-test
/test pull-integration-common-test
/test pull-integration-copr-test
/test pull-integration-jdbc-test
/test pull-integration-mysql-test
/test pull-integration-nodejs-test
/test pull-integration-python-orm-test
/test pull-scan-deps
/test pull-sqllogic-test
/test pull-tiflash-test

Use /test all to run the following jobs that were automatically triggered:

pingcap/tidb/ghpr_build
pingcap/tidb/ghpr_check
pingcap/tidb/ghpr_check2
pingcap/tidb/ghpr_mysql_test
pingcap/tidb/ghpr_unit_test
pingcap/tidb/pull_integration_ddl_test
pingcap/tidb/pull_integration_e2e_test
pingcap/tidb/pull_mysql_client_test

In response to this:

/test unit-test

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.

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.

@tiancaiamao

Copy link
Copy Markdown
Contributor Author

/test unit-test

@tiprow

tiprow Bot commented Apr 24, 2025

Copy link
Copy Markdown

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

Details

In response to this:

/test unit-test

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.

@tiancaiamao

Copy link
Copy Markdown
Contributor Author

/check-issue-triage-complete

@ti-chi-bot ti-chi-bot Bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 15, 2025

@cfzjywxk cfzjywxk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should the document be upated too?

@ti-chi-bot

ti-chi-bot Bot commented May 16, 2025

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cfzjywxk, XuHuaiyu

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

The pull request process is described here

Details 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

@ti-chi-bot ti-chi-bot Bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 16, 2025
@ti-chi-bot

ti-chi-bot Bot commented May 16, 2025

Copy link
Copy Markdown

[LGTM Timeline notifier]

Timeline:

  • 2025-05-15 06:40:14.792786589 +0000 UTC m=+8381.048683985: ☑️ agreed by XuHuaiyu.
  • 2025-05-16 06:33:48.467874041 +0000 UTC m=+94394.723771438: ☑️ agreed by cfzjywxk.

@tiprow

tiprow Bot commented May 16, 2025

Copy link
Copy Markdown

@tiancaiamao: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
tidb_parser_test 98195dd link true /test tidb_parser_test
fast_test_tiprow 98195dd link true /test fast_test_tiprow

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@ti-chi-bot
ti-chi-bot Bot merged commit a206b0b into pingcap:master May 16, 2025
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request May 16, 2025
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot

Copy link
Copy Markdown
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #61150.
But this PR has conflicts, please resolve them!

@ti-chi-bot ti-chi-bot Bot added the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label Jul 8, 2025
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jul 8, 2025
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot

Copy link
Copy Markdown
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #62276.
But this PR has conflicts, please resolve them!

@ti-chi-bot

Copy link
Copy Markdown
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #62280.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make @@tidb_distsql_scan_concurrency hint work for keep order request

4 participants