What is the purpose of the space_placeholder_file in a TiFlash instance?

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

Original topic: tiflash实例中有space_placeholder_file这个文件是做什么用的?

| username: residentevil

[TiDB Usage Environment] Production Environment
[TiDB Version] v7.1.4
[Encountered Problem: Problem Description and Impact] What is the purpose of the space_placeholder_file in the tiflash instance? I see that this file occupies nearly 300GB of space.

| username: hey-hoho | Original post link

I haven’t specifically looked into TiFlash, but there is such a file in TiKV, and its function is as follows:

If TiFlash also has it, its function should be similar.

| username: DBAER | Original post link

Tricky and unconventional techniques, afraid of the disk getting full, not easy to handle.

| username: xiaoqiao | Original post link


| username: Jack-li | Original post link

Reserve space for the disk.

| username: 呢莫不爱吃鱼 | Original post link

I checked the path of tiflash, which is ./tidb-data/tiflash-9000/flash/space_placeholder_file. It’s similar to the approach used with SQL Server, creating a large data file to occupy disk space. If something goes wrong, there’s a backup plan~ :joy:

| username: zhaokede | Original post link

Placeholder file, as can be seen from the file name.

| username: 随缘天空 | Original post link

It should be used to reserve disk space for the TiFlash instance.