Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 建议增加mdl 锁超时参数
TiDB version: 6.5.3
If executing DDL encounters MDL lock blocking, it seems that the DDL currently does not have a timeout mechanism and keeps executing (I checked the documentation but couldn’t find it). Shouldn’t a timeout mechanism be added here, similar to MySQL’s parameter lock_wait_timeout
?
How to simulate an MDL lock?
v6.5.3
session 1
begin;
select * from monitor;
session 2
truncate table monitor;
Then you will see that session 2 keeps executing, and it seems there is no timeout mechanism.
There might be, probably implicit parameters. I haven’t seen any explicit parameters.
Parameters are available.
Are there any parameters?
It is probably a prediction within a prediction, more to come 
Directly took over the product manager’s job.
This requirement is good. I encountered it before as well. You can only wait for the transaction to complete, and if it’s a private transaction, it’s really annoying.
Indeed, implementing it this way is a bit uncomfortable. Adding a parameter would be better.
Yes, there is a timeout parameter control, so you don’t have to worry about it taking too long, failing to complete, and affecting subsequent DDL operations.
Not taking it, not taking it, just borrowing it to serve some food, will return it shortly, hahaha.
It looks like a product requirement. I have moved it to the product needs category~
Predicted the prediction? 
lock-wait parameter with timeout mechanism