How to handle DDL operation hang?

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

Original topic: ddl操作hang住,怎么处理?

| username: dxss-lee

I have a question. There is a DDL statement that has not been completed for a long time. I used admin cancel on them, but the status remains as cancelling. Restarting the cluster did not improve the situation. Now, I am completely unable to perform any DDL operations. How should I handle this situation?

| username: xfworld | Original post link

Take a look at this…

I suggest checking the execution status of the DDL

| username: h5n1 | Original post link

Is it just this one DDL job? Use admin show ddl jobs to check the others.

| username: dxss-lee | Original post link

Two jobs have been in the cancelling state for a long time.

| username: h5n1 | Original post link

Is there a job_id 9116, and what is its status?

| username: dxss-lee | Original post link

There is no task with jobid 9916.

| username: h5n1 | Original post link

Check if there is any information in the TiDB logs.

| username: 裤衩儿飞上天 | Original post link

Observing and learning~ :rofl:

| username: dxss-lee | Original post link

I shut down the cluster for 2 hours, and after restarting, I found that the task was already in a canceled state. It seems like the cancellation was particularly slow.

| username: dxss-lee | Original post link

I checked all my TiDB instances and found that none of them are the DDL owner.

| username: dxss-lee | Original post link

I restarted all the TiDB server instances, and the result of select tidb_is_owner() for one instance became 1. The tasks in the queue were immediately completed.

| username: jansu-dev | Original post link

This is an issue closely related to the owner. You can check the tidb.log to analyze why the owner cannot be selected. Temporarily marking it as resolved.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.