Creating Index Hangs

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

Original topic: 创建索引卡死

| username: breakyang

[Test Environment for TiDB] Testing
[TiDB Version] 7.1.0
[Reproduction Path] Creating an index
[Encountered Problem: Phenomenon and Impact]

index

CREATE UNIQUE INDEX uni_xx_xx ON xx.xx (tx_id, sequence);
Stuck
Log:
[ddl_worker.go:980] [“[ddl] run DDL job”] [worker=“worker 7, tp add index”] [job=“ID:152, Type:add index, State:running, SchemaState:none, SchemaID:146, TableID:150, RowCount:0, ArgLen:0, start time: 2023-07-25 09:17:03.05 +0000 UTC, Err:[ddl:-1]cannot get disk capacity at /tmp/tidb/tmp_ddl-4000: no such file or directory, ErrCount:510, SnapshotVersion:0, UniqueWarnings:0”]

| username: 啦啦啦啦啦 | Original post link

Was it upgraded from a lower version? Try manually creating the /tmp/tidb/tmp_ddl-4000 directory and granting the necessary permissions before trying again.

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

I’ve seen this issue several times. Manually create the /tmp/tidb/tmp_ddl-4000 directory.

| username: zhanggame1 | Original post link

Every few days, someone asks about this. If the error directory doesn’t exist, create it manually. If it does exist, give it 777 permissions.

| username: breakyang | Original post link

What is the root cause? How can it be avoided?

| username: breakyang | Original post link

Self Q&A: This bug has been fixed.
For the reason, please refer to

| username: Rilakkuma | Original post link

Configure temp-dir to an available path, or manually create the default path for temp-dir at /tmp/tidb

| username: 胡杨树旁 | Original post link

I encountered this problem today as well. I upgraded from version 7.0.0, but I don’t know why this directory wasn’t created automatically.

| username: TiDBer_iCdTOZ1r | Original post link

First, kill it.

| username: zhanggame1 | Original post link

This is a bug, waiting for a fix.

| username: breakyang | Original post link

The fix is already included in v7.1.1.

| username: redgame | Original post link

Check the permissions of the /tmp/tidb/tmp_ddl-4000 directory.

| username: 胡杨树旁 | Original post link

The version I am using is 7.1.1, but this version was upgraded from version 7.1.0, and there is no such directory.

| username: system | Original post link

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