executor: unify executor concurrency#16999
Conversation
|
Thanks for your contribution. If your PR get merged, you will be rewarded 300 points. |
b5635f5 to
bd39e1a
Compare
|
@SunRunAway friendly ping 😀 |
There was a problem hiding this comment.
Hi, @niedhui
Firstly I apologize for the late reply.
Do you mean remove all the existing concurrency system variable, and make these as user-defined variable for compatibility?
I have to send my second apology to you that I misunderstood what you said and might give the wrong information to you. And the issue description may also lead us to an unexpected way.
It's not related to The user-defined variable.
What we want is,
- introduce a session and global variable
tidb_executor_concurrency, which defaults to the numbers of CPU cores. - change the default session and global variable
tidb_hash_join_concurrencytoNULL - if
tidb_hash_join_concurrencyisNULL, apply the Hash Join concurrency bytidb_executor_concurrency, or bytidb_hash_join_concurrencyfor compatibility.
We do not need really remove existing concurrency system variables, but only deprecate and hide to new users for tidb v4.0.
For users upgraded from old versions, we may introduce a bootstrap policy,
- If all the global concurrency variables are the default value in old versions, we may assume that users haven't changed even one of them. So tidb-server can set all the global concurrency variables to
NULL, the default value in new version, to make use oftidb_executor_concurrencyin bootstrap.go
|
🤣 Welcome back, mentor. I'll update this tomorrow |
Then will the user still be able to change these deprecated variables using SQL? like |
Yes. And the code is like, |
Signed-off-by: niedhui <niedhui@gmail.com>
bd39e1a to
7580be5
Compare
|
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
SunRunAway
left a comment
There was a problem hiding this comment.
For users upgraded from old versions, we may introduce a bootstrap policy,
If all the global concurrency variables are the default value in old versions, we may assume that users haven't changed even one of them. So tidb-server can set all the global concurrency variables to NULL, the default value in new version, to make use of tidb_executor_concurrency in bootstrap.go
|
And best to update the PR description for your newest code and add a release note for the check_release_note bot. |
Seems in |
…/unify_executor_concurrency
Signed-off-by: niedhui <niedhui@gmail.com>
|
@sre-bot /run-all-tests |
|
@sre-bot /run-integration-br-test br=pr/362 |
9c00501 to
00bccb3
Compare
Signed-off-by: niedhui <niedhui@gmail.com>
00bccb3 to
b861379
Compare
|
@sre-bot /run-all-tests |
|
@sre-bot /run-unit-test |
|
@sre-bot /run-common-test |
|
/run-integration-br-test |
|
@kennytm It seems that the BR command-line binary does not use the version in this pull request as a dependency. |
|
@SunRunAway We could modify the BR CI to add a replace the Also, even if this trick allows the |
|
Hi @zz-jason, I add an |
|
/merge |
|
/run-all-tests |
|
@niedhui merge failed. |

UCP #15428
What problem does this PR solve?
Issue Number: part of #15428
Problem Summary:
What is changed and how it works?
What's Changed:
Deprecated existing executor-concurrency related variables, use a single
ExecutorConcurrenyto control the concurrency of all types of executors.How it Works:
ExecutorConcurrencyto control the concurrency of all types of executors.sessionctx/Concurrencywere hidden, and use the exported functions to get the valueExecutorConcurrencywas returned.Updates
We have nine executor-concurrency related variables:
I planed to migrate these variables in the following steps:
ExecutorConcurrency. Because the original default value of these variables is all 4, by making the default value ofExecutorConcurrencyto 4 (not the number of cups), we would not break too many teststidb_hash_join_concurrencyandtidb_distsql_scan_concurrencyin the following PR, the original default value of these two is 5 and 15, we may discuss the default fixed-value ofExecutorConcurrenyin the PR, 4 or 15, and this will break many tests, inTiDB,mysql-testerandcopr-test, I would make changes on these repos by setting the fixed value of the concurrency variables.tidb_index_serial_scan_concurrencywill be kept since it's used by analyze-table as @SunRunAway suggested.Known issues about tests currently :
We should only use
set @@session.tidb_executor_concurrenly=to control the concurrency of executor, the execution plan may not be the same as it is, which may lead to lots of changes for currency tests.Check List
ExecutorConcurrencymysql.global_variablesTests
Release note
Deprecate
tidb_index_lookup_concurrency,tidb_index_lookup_join_concurrency,, `tidb_hashagg_partial_concurrency`, `tidb_hashagg_final_concurrency`, `tidb_window_concurrency`, `tidb_projection_concurrency` anduse the newtidb_executor_concurrencyinstead.