Error Adding Index ERROR 1105 (HY000): DDL job rollback, error msg: cannot get disk capacity at

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

Original topic: 加索引报错ERROR 1105 (HY000): DDL job rollback, error msg: cannot get disk capacity at

| username: TiDBer_8xw9Q7ml

Adding an index takes a long time and then reports an error.

| username: TiDBer_8xw9Q7ml | Original post link

How to solve this problem?

| username: WalterWj | Original post link

Did you use fast DDL, and then the disk for fast DDL was not enough to roll back? TiDB 分布式执行框架 | PingCAP 文档中心

| username: TiDBer_8xw9Q7ml | Original post link

How do I look at this?

| username: TiDBer_8xw9Q7ml | Original post link

Previously, it was also not possible to add an index; you could only add an index when creating a new table.

| username: zhanggame1 | Original post link

Have you configured this? Is the temporary disk space on the TiDB node large enough?

| username: dba远航 | Original post link

If the hard drive is insufficient or reaches the warning threshold, it will cause DDL to fail.

| username: TiDBer_8xw9Q7ml | Original post link

Is it not possible to add an index without configuring this?

| username: wangccsy | Original post link

Check if the disk space is insufficient.

| username: zhanggame1 | Original post link

According to the screenshot, there is a parameter to disable fast DDL.

| username: TiDBer_8xw9Q7ml | Original post link

I have already added the directory. Although there are no errors, it keeps executing for a long time.

| username: WalterWj | Original post link

Under fast DDL, adding an index involves generating KV storage files on the TiDB server and then importing them into the TiKV cluster to speed up the process. Therefore, the TiDB server requires a large and high-performance disk. If this condition is not met, you can disable fast DDL. The time to add an index depends on the amount of data in the table; the more data in the table, the longer it takes to add the index.

| username: 大飞哥online | Original post link

The parameter temp-dir changes the temporary file directory, the default is .tmp/tidb. Check if this space is full.

| username: Jellybean | Original post link

The time it takes to add an index is usually positively correlated with the amount of data in the table. If your table is relatively large, it is expected that adding an index will take a long time.

However, after version v7.1.0, the speed of adding indexes should be quite fast.
If you can provide more detailed information, we can analyze it more thoroughly.

| username: 霸王龙的日常 | Original post link

Solution:

  1. Check the DDL execution information
mysql> admin show ddl;

Pay attention to the OWNER_ADDRESS field value, for example, if it is 172.1.1.2:4000, the port is 4000.

  1. Create a directory
mkdir -p /tmp/tidb/tmp_ddl-4000
chown tidb:tidb /tmp/tidb/tmp_ddl-4000

Note: Replace 4000 with the actual port.

| username: lemonade010 | Original post link

Learned, Mark

| username: WinterLiu | Original post link

Learned, learned.

| username: xingzhenxiang | Original post link

Another method is to disable fast index creation.

| username: 双开门变频冰箱 | Original post link

The disk is probably out of space.

| username: TiDBer_8xw9Q7ml | Original post link

The image is not visible. Please provide the text you need translated.