pingcap / pingcap/tidb

PD Request from TiDB Should Honor Query max_execution_time

Open
#56,753 1 comment 1 reaction 0 assignees View on GitHub
type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement
Currently, TiDB queries are terminated when they exceed max_execution_time, but the PD requests generated by these queries, such as GetRegion calls, do not adhere to the same timeout constraint.

The default PD RPC timeout (3 seconds) is relatively long compared to the max_execution_time for time-sensitive OLTP workloads. In some cases, even after TiDB has terminated the queries, their PD requests continue to retry on the PD, leading to unnecessary resource consumption. In extreme scenarios, we've observed that PD can become overwhelmed by a flood of these retried requests from TiDB.

As an enhancement, PD requests like GetRegion calls should honor the same timeout as the originating TiDB queries, enforced via the Go context. This would ensure that resources consumed by PD RPC calls are promptly released when the parent queries are terminated.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.