Can files in the tmp-storage-path be deleted?

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

Original topic: tmp-storage-path 路径中的文件,可以删除么?

| username: OnTheRoad

[TiDB Usage Environment] Production Environment
[TiDB Version] v5.3.0
[Encountered Issue: Issue Phenomenon and Impact]
[Resource Configuration]
[Attachment: Screenshot/Log/Monitoring]
The temporary directory of the TiDB instance is filled with SQL temporary files. I checked the creation date, and it was several days ago. Will these files be automatically deleted? Or do they need to be manually deleted?

| username: Meditator | Original post link

  1. Temporary files for several days feel unexpected; theoretically, they should be released once the SQL execution is complete.
  2. This is unexpected. Use lsof to check the chunk.Listxxxx files and see if the temporary file handles are held by the TiDB user or process.
  3. If the temporary files are not being held, theoretically, they can be deleted without any impact, considering so many days have passed.
  4. It is speculated that there might have been an issue with the SQL execution at that time, causing an abnormal termination and resulting in the temporary files not being released. Of course, this is just a speculation; it could also be due to other issues.
| username: OnTheRoad | Original post link

At that time, the SQL execution caused an OOM, and the TiDB instance restarted.

| username: Minorli-PingCAP | Original post link

If not occupied, it can be deleted. For situations where it is full, it is recommended to set the relevant parameters properly.

| username: system | Original post link

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