Issues with Dirty Data Generated After Sysbench Stress Testing

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

Original topic: sysbench压力测试后产生的脏数据问题

| username: 随缘天空

[TiDB Usage Environment] Production Environment
[TiDB Version] V7.1.1
[Encountered Problem: Phenomenon and Impact] After stress testing, the disk used more than 20GB. Before official use, I want to delete this data, but I don’t know which files or directories in the tikv corresponding data directory can be deleted. I’m afraid of misoperation affecting usage.
The directory at the arrow in the picture is the one occupying a large space.
[Attachment: Screenshot/Log/Monitoring]

| username: h5n1 | Original post link

Apart from the .log files, don’t touch anything else. In TiDB, truncate will wait for GC to reclaim space. However, 20GB isn’t that much.

| username: 随缘天空 | Original post link

Okay, thank you. I just checked, and indeed about 10GB of disk space has been freed up.

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

Just drop the corresponding database for the stress test, and the system will automatically perform garbage collection to reclaim disk space.

| username: zhanggame1 | Original post link

The fastest way is to restart the cluster, which will automatically delete a lot of useless data.

| username: cassblanca | Original post link

Why not just use a script to list the objects in the database, drop them in batches, and let the system automatically GC to free up space? Or wouldn’t it be faster to directly DROP DATABASE?

| username: kavenab | Original post link

The data in sysbench is all in a single schema, which is easy to clean up, but it doesn’t take up much space.

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

Directly delete the sbtest database, and it will be released after the garbage collection is completed.

| username: Inkjade | Original post link

Just drop the corresponding database. No other operations are needed.

| username: ShawnYan | Original post link

  1. truncate table,
  2. Confirm whether GC is enabled, then wait for the next GC to complete.
| username: redgame | Original post link

Just delete it.

| username: zhanggame1 | Original post link

Do not delete file system files, it is very risky. For testing, you can first drop the test table, wait for the GC time to pass, and then reload the database. The disk space will be released.

| username: 有猫万事足 | Original post link

Do not delete data files. Use “truncate table” or “drop database” and wait for a while for it to be reclaimed.

| username: system | Original post link

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