Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 创建索引或者增加主键报no enough space in /tmp/tidb/tmp_ddl-4000是怎么回事啊
[Test Environment for TiDB]
[TiDB Version] 8.0.0
[Reproduction Path] Operations performed that led to the issue
CREATE TABLE t0(c0 BOOL);
CREATE INDEX i0 ON t0(c0);
ALTER TABLE t0 ADD PRIMARY KEY(c0);
[Encountered Issue: Issue Phenomenon and Impact]
Both of the following statements result in an error:
ERROR 8256 (HY000): Check ingest environment failed: no enough space in /tmp/tidb/tmp_ddl-4000
[Resource Configuration] Using 1 PD and 3 TiKV
TiDB is running in a Docker container. I checked the /tmp/tidb/tmp_ddl-4000 folder, and it is only 4.0KB.
The default parameters for building an index may use the disk.
This issue is caused by fast online DDL using disk temporarily to speed up the execution of some DDLs, and the default space is insufficient. You can set it to a directory with more space.
Try changing the directory.
Ensure there is enough space in the temporary directory.
It may be due to insufficient permissions for non-root users.
The space in the directory /tmp/tidb/tmp_ddl-4000 is not enough.
Check if the disk space is insufficient.
Insufficient temporary folder capacity