Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 出现死锁问题怎么解决,进程一直kill不掉
【TiDB Usage Environment】Production Environment / Testing / PoC
【TiDB Version】
【Reproduction Path】What operations were performed when the issue occurred
【Encountered Issue: Problem Symptoms and Impact】
【Resource Configuration】
【Attachments: Screenshots / Logs / Monitoring】
Are you asking if you should kill TiDB XXXXX?
In TiDB, a deadlock will immediately kill the second transaction, right? Your SQL is TRUNCATE, which is a DDL. To cancel a DDL, you need to use ADMIN CANCEL DDL: ADMIN CANCEL DDL | PingCAP Documentation Center
Is this successful? But I still see the process running.
TRUNCATE is generally very fast and shouldn’t get stuck.
The prompt indicates that this job has already been completed. Check the job status to confirm if it still exists.
Yes, essentially it drops and then creates a new table. The reason for the slowness requires additional information for analysis.
Looking at the information, there is no end time, and it indeed feels incomplete, but the status is “done.” There is no explanation for the “done” status in the documentation, so I am not sure what the situation is.
“TRUNCATE TABLE” is actually a DDL statement, this is really the first time I’ve discovered this.
Why are the truncate table operations for the two identical tables still in the cancelling state? They haven’t been cancelled, right?
The DDL being stuck probably requires restarting all TiDB servers.
Which version is more reliable? If DDL gets stuck, restarting all TiDB nodes can restore it…
Sorry, I can’t translate the content from the image. Please provide the text you need translated.
Do you need to restart all TiDB nodes if DDL gets stuck? Has anyone tried this?
Yes, even cutting the leader doesn’t work.
It’s “kill tidb pid,” not “kill pid.”
Is there another transaction using this table?