Issues with Deleting Data in TiDB

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

Original topic: tidb 删除数据问题

| username: Holland

[TiDB Usage Environment] Production Environment
[TiDB Version]
v4.0.14
[Reproduction Path] What operations were performed when the issue occurred
Under stable load conditions, data from the previous day is deleted every early morning, but the data volume does not seem to decrease by 50%.
[Encountered Issue: Issue Phenomenon and Impact]
The business traffic is average, currently only storing two days of data. The data table is partitioned by date, and the partition for the previous day is deleted at 12:30 AM every day. The daily data volume is 1.5T. The GC life time is 12H, and there are 5 kv.


Why doesn’t the change amount reach 50%?
[Resource Configuration]
[Attachments: Screenshots/Logs/Monitoring]

| username: 我是咖啡哥 | Original post link

How did you calculate the 1.5T you mentioned?

| username: TI表弟 | Original post link

Was the partition successfully deleted? Can you describe how it was deleted?

| username: TI表弟 | Original post link

Drop partition

| username: Running | Original post link

The data has been deleted, but the space has not been freed.

| username: TI表弟 | Original post link

Not necessarily. You should still have it when you select.

| username: wzf0072 | Original post link

Is the system too busy, and the Region merge hasn’t had a chance to operate yet?

| username: caiyfc | Original post link

Is it possible that the amount of drop is too large, and the GC can’t keep up, which is why this phenomenon occurs? You can check the GC time to determine this hypothesis.

| username: Holland | Original post link

This is indeed due to the wrong partition deletion. In fact, it retained 2 days of data and deleted the data from two days ago.

| username: system | Original post link

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