pingcap / tidb

TiDB - the open-source, cloud-native, distributed SQL database designed for modern applications.
https://pingcap.com
Apache License 2.0
37.27k stars 5.84k forks source link

`max_execution_time` doesn't contain get tso time #51893

Open aytrack opened 8 months ago

aytrack commented 8 months ago

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

from https://asktug.com/t/topic/1023086

  1. set max_execution_time = 3000
  2. execute sql get tso from pd exceed 3s 图片

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

the query should interrupted after 3s

3. What did you see instead (Required)

the query run longer than 3s

4. What is your TiDB version? (Required)

master

yibin87 commented 6 months ago

/severity major

yibin87 commented 6 months ago

/remove-severity moderate

guo-shaoge commented 2 months ago

After asking help from @MyonKeminta , this is related to transaction and pd-client module.

  1. DurationWaitTs is the get tso duration.
  2. tf.future.Wait() is the main waiting function, it's an pd-client interface, but this interface doesn't has any method to interrupt get tso process.
  3. need change pd-client to add method to interrupt getting tso process: tsoRequest
cfzjywxk commented 1 month ago

@guo-shaoge I think the severity could be lowered, in most cases it would be a big problem.