DDL operation takes 6 minutes

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

Original topic: ddl 操作耗时6min

| username: 胡杨树旁

[TiDB Usage Environment] Production Environment
[TiDB Version] 6.1.5
Executing DDL operations, the execution time is around 6 minutes. The DDL-related parameters have been increased, but there is no change in execution efficiency before and after the adjustment.


image

| username: h5n1 | Original post link

They are all empty tables.

| username: 胡杨树旁 | Original post link

I checked it, and basically, all the tables have data, some more and some less.

| username: 胡杨树旁 | Original post link

I don’t know why it shows as an empty table.

| username: zhanggame1 | Original post link

Try analyzing the table?

| username: tidb菜鸟一只 | Original post link

It doesn’t look right. Why does the column for modified rows all show 0? Does the field you added have a default value?

| username: 胡杨树旁 | Original post link

I found the cause of the problem. The cluster was previously upgraded, but the upgrade failed, and one of the TiDB nodes couldn’t start. After stopping that node, the DDL recovered.

| username: zhanggame1 | Original post link

Stop that component?

| username: TiDBer_小阿飞 | Original post link

Did you scale down one of the TiDB server nodes?

| username: 随缘天空 | Original post link

Yes, it is possible that the request was made to a node that has already been stopped, increasing the waiting time.

| username: heiwandou | Original post link

Waiting for unresponsive nodes

| username: 胡杨树旁 | Original post link

Stopped, and then it was very fast.

| username: 胡杨树旁 | Original post link

Yes, it stopped.

| username: 这里介绍不了我 | Original post link

Still need to analyze calmly.

| username: oceanzhang | Original post link

Upgrade failed, don’t they check afterwards?

| username: 胡杨树旁 | Original post link

Upgrade failed. There was an error at the time, but I didn’t have time to deal with it. However, the application side didn’t know during testing, as the project was still in the testing phase. Later, it was redeployed.

| username: oceanzhang | Original post link

For this kind of testing, the major issue is when the upgrade fails, which urgently needs to be addressed. I don’t understand why the database’s inherent problems are not resolved before continuing with the tests.

| username: oceanzhang | Original post link

If it were in our hands, the upgrade issue would either be resolved or the testing would be terminated.