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

There is no way to use unparallel projection executor #25497

Open
tiancaiamao opened this issue Jun 16, 2021 · 0 comments
Open

There is no way to use unparallel projection executor #25497

tiancaiamao opened this issue Jun 16, 2021 · 0 comments
Labels
component/executor severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@tiancaiamao
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Set tidb_projection_concurrency variable to 0 doesn't work, this variable is deprecated:

mysql> set @@tidb_projection_concurrency = 0;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                                                           |
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------+
| Warning | 1287 | 'tidb_projection_concurrency' is deprecated and will be removed in a future release. Please use tidb_executor_concurrency instead |
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

Set variable tidb_executor_concurrency to 0 doesn't work, 0 is not a valid value for it:

mysql> set @@tidb_executor_concurrency = 0;
ERROR 1231 (42000): Variable 'tidb_executor_concurrency' can't be set to the value of '0'
mysql> set @@tidb_executor_concurrency = -1;
ERROR 1231 (42000): Variable 'tidb_executor_concurrency' can't be set to the value of '-1'
mysql> set @@tidb_executor_concurrency = -2;
ERROR 1231 (42000): Variable 'tidb_executor_concurrency' can't be set to the value of '-2'

Set variable tidb_executor_concurrency to 1 doesn't really work,

mysql> set @@tidb_executor_concurrency = 1;
Query OK, 0 rows affected (0.00 sec)

because the code requires the value less than or equal to 0:

tidb/executor/projection.go

Lines 185 to 187 in efc774a

func (e *ProjectionExec) isUnparallelExec() bool {
return e.numWorkers <= 0
}

So, when we set tidb_executor_concurrency to 1, we actually spawn one worker and the main goroutine is waiting for the worker to finish the job.

This code branch is never covered

return e.unParallelExecute(ctx, req)

2. What did you expect to see? (Required)

I want to make sure projection runs non-concurrently ...

3. What did you see instead (Required)

There is no way to do that.

4. What is your TiDB version? (Required)

commit efc774a (HEAD -> master, origin/master, origin/HEAD)
Author: ZhuoZhi 517770911@qq.com
Date: Wed Jun 16 15:12:37 2021 +0800

planner: check filter condition in func convertToPartialTableScan (#25294)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/executor severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants