Speed up the possible slow cop task
Open
type/enhancement
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Enhancement
I've recently investigated a slow cop task, which is caused by small concurrency. We choose concurrency when building the cop iterator, if the number of tasks is small, the concurrency will be reduced.
https://github.com/pingcap/tidb/blob/191503599a39685da39e85cc80fdabeb81f08ee2/store/copr/coprocessor.go#L197-L200
In my case, 1 task will fail by region miss and retry, and the latest region info re-split it into hundreds of regions, because we choose 1 concurrency before running the task, 1 worker handle the re-split tasks in serial order, which causes the slow query.
Contributor guide
Assessment
This issue has not been assessed yet.