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

max_execution_time doesn't take affect when build cop requests takes too much time #55957

Closed
yibin87 opened this issue Sep 9, 2024 · 8 comments
Labels
affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 report/customer Customers have encountered this bug. severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@yibin87
Copy link
Contributor

yibin87 commented Sep 9, 2024

Enhancement

The following query sets max_execution_time to 2s, but it actually takes 18.8s. It's checked that the build_task_duration takes most of the time, due to too many region reloading. This issue aims to add "max_execution_time check point" in build task process.
mysql> explain analyze SELECT
/*+ MAX_EXECUTION_TIME(2000) */
*
FROM
Name0 FORCE INDEX (PRIMARY)
WHERE
Name0.o_id >= ?
AND Name0.m_id = ?
AND ((Name0.o_id > ?))
ORDER BY
Name0.o_id
LIMIT
50;
| id | estRows | estCost | actRows | task | access object | execution info | operator info | memory | disk |
| Limit_11 | 50.00 | 1416150.54 | 50 | root | | time:980.5µs, loops:2 | offset:0, count:50 | N/A | N/A |
| └─TableReader_20 | 50.00 | 1416150.54 | 50 | root | | time:977.4µs, loops:1, cop_task: {num: 1, max: 928.1µs, proc_keys: 96, tot_proc: 418.5µs, tot_wait: 24.1µs, rpc_num: 1, rpc_time: 906.1µs, copr_cache_hit_ratio: 0.00, build_task_duration: 18.8s, max_distsql_concurrency: 2} | data:Limit_19 | 113.7 KB | N/A |
| └─Limit_19 | 50.00 | 21135338.17 | 50 | cop[tikv] | | tikv_task:{time:0s, loops:2}, scan_detail: {total_process_keys: 96, total_process_keys_size: 75762, total_keys: 147, get_snapshot_time: 3.07µs, rocksdb: {delete_skipped_count: 69, key_skipped_count: 310, block: {cache_hit_count: 19, read_count: 2, read_byte: 47.6 KB, read_time: 16.2µs}}} | offset:0, count:50 | N/A | N/A |
| └─Selection_18 | 50.00 | 21135338.17 | 96 | cop[tikv] | | tikv_task:{time:0s, loops:2} | eq(DB.Name0.m_id, ?) | N/A | N/A |
| └─TableRangeScan_17 | 50000.00 | 18640338.17 | 96 | cop[tikv] | table:Name0 | tikv_task:{time:0s, loops:2} | range:(?,+inf], keep order:true, stats:pseudo | N/A | N/A |

@yibin87 yibin87 added the type/enhancement The issue or PR belongs to an enhancement. label Sep 9, 2024
@yibin87
Copy link
Contributor Author

yibin87 commented Sep 10, 2024

/report customer

@ti-chi-bot ti-chi-bot bot added the report/customer Customers have encountered this bug. label Sep 10, 2024
@yibin87
Copy link
Contributor Author

yibin87 commented Sep 10, 2024

/type bug

@ti-chi-bot ti-chi-bot bot added the type/bug The issue is confirmed as a bug. label Sep 10, 2024
@yibin87
Copy link
Contributor Author

yibin87 commented Sep 10, 2024

/remove-type enhancement

@ti-chi-bot ti-chi-bot bot removed the type/enhancement The issue or PR belongs to an enhancement. label Sep 10, 2024
@yibin87
Copy link
Contributor Author

yibin87 commented Sep 10, 2024

/label affects-7.5

@ti-chi-bot ti-chi-bot bot added the affects-7.5 This bug affects the 7.5.x(LTS) versions. label Sep 10, 2024
@yibin87
Copy link
Contributor Author

yibin87 commented Sep 10, 2024

/label affects-8.1

@ti-chi-bot ti-chi-bot bot added the affects-8.1 This bug affects the 8.1.x(LTS) versions. label Sep 10, 2024
@yibin87
Copy link
Contributor Author

yibin87 commented Sep 19, 2024

/label affects-7.1

@ti-chi-bot ti-chi-bot bot added affects-7.1 This bug affects the 7.1.x(LTS) versions. and removed may-affects-7.1 labels Sep 19, 2024
@yibin87
Copy link
Contributor Author

yibin87 commented Sep 19, 2024

/remove-label affects-7.1

@ti-chi-bot ti-chi-bot bot removed the affects-7.1 This bug affects the 7.1.x(LTS) versions. label Sep 19, 2024
@yibin87
Copy link
Contributor Author

yibin87 commented Sep 23, 2024

Already fixed by linked PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 report/customer Customers have encountered this bug. severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants