After TiKV Scaling Down, Some SST Files Are Gradually Being Deleted

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

Original topic: TiKV缩容后,还遗漏了一下SST在逐步删除

| username: dba-kit

I have a question: After scaling down a node, its status is already Tombstone, and the number of regions on the monitoring is also 0. Why is there still more than 300G of space? It seems that many SST files are left behind, and the time distribution of these SST files is from a month ago.

| username: dba-kit | Original post link

The log shows delete data in range because of stale, suspecting that there are expired ranges that have not been cleaned up. (When other nodes were scaled down, after the region became 0, the disk space was almost 0, and there was not so much space left)

| username: TiDBer_oHSwKxOH | Original post link

This is not a bug, right?

| username: Fly-bird | Original post link

No impact, right?

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

When you prune the tombstone, do these SST files still exist?

| username: dba-kit | Original post link

After pruning, the files will indeed be deleted. However, I’m quite curious why, after a node’s region becomes 0, some nodes will have several hundred GB of leftover SST files, while others have very few, only a few GB.

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

I think pruning is similar to compacting, and offline region migration is similar to garbage collection. Region decommissioning only marks it as no longer in use and does not actually delete the corresponding SST files. It is only when you prune that the files are truly deleted.

| username: 大飞哥online | Original post link

When scaling down the cluster, certain components will not immediately stop services and delete data. Instead, after the data scheduling is completed, users need to manually execute the tiup cluster prune command to clean up.
Learned something new. It seems that from now on, whenever scaling down, we need to manually execute prune.

| username: 像风一样的男子 | Original post link

Explain that reducing capacity is done infrequently; you’ll get used to it after doing it a few more times.

| username: zhanggame1 | Original post link

I think prune directly physically removes the files.

| username: dba-kit | Original post link

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