Suggestion to Add MDL Lock Timeout Parameter

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 建议增加mdl 锁超时参数

| username: Raymond

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.

| username: 大飞哥online | Original post link

There might be, probably implicit parameters. I haven’t seen any explicit parameters.

| username: Fly-bird | Original post link

Parameters are available.

| username: Raymond | Original post link

Which parameter?

| username: 大飞哥online | Original post link

Which one? ddl_timeout?

| username: Kongdom | Original post link

Are there any parameters?

| username: 大飞哥online | Original post link

It is probably a prediction within a prediction, more to come :face_with_peeking_eye:

| username: Kongdom | Original post link

:joy: Directly took over the product manager’s job.

| username: 路在何chu | Original post link

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.

| username: Kongdom | Original post link

Indeed, implementing it this way is a bit uncomfortable. Adding a parameter would be better.

| username: 大飞哥online | Original post link

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.

| username: 大飞哥online | Original post link

Not taking it, not taking it, just borrowing it to serve some food, will return it shortly, hahaha.

| username: Billmay表妹 | Original post link

It looks like a product requirement. I have moved it to the product needs category~

| username: TiDBer_小阿飞 | Original post link

Predicted the prediction? :rofl:

| username: heiwandou | Original post link

lock-wait parameter with timeout mechanism

| username: Kongdom | Original post link

:+1::+1::+1:

| username: Raymond | Original post link

Which parameter is it?