Can the /tidb-data/tikv-20160/raft-engine logs be deleted using rm -fr?

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

Original topic: /tidb-data/tikv-20160/raft-engine 日志可以rm -fr 删除吗?

| username: zxxz

[TiDB Usage Environment] Test Environment
[TiDB Version] v6.3.0
[Reproduction Path] /tidb-data/tikv-20160/raft-engine
[Encountered Problem: Phenomenon and Impact]
Can the log files in /tidb-data/tikv-20160/raft-engine/ be directly deleted using rm -fr? Will it have any impact? The disk usage is too high.

[Attachment: Screenshot/Log/Monitoring]

| username: srstack | Original post link

:face_with_open_eyes_and_hand_over_mouth: Don’t delete it, check if there are any anomalies in the raft log in the tikv details monitoring.

| username: zhanggame1 | Original post link

No, it is a very, very important document. TiDB writes to the Raft log first and then to RocksDB by default. The Raft log by default occupies up to 4GB of space and is used cyclically, so you don’t need to worry about it taking up a lot of space.

| username: 小龙虾爱大龙虾 | Original post link

You didn’t delete it, right? This contains data and must not be deleted.

| username: 江湖故人 | Original post link

Cannot delete, in the test environment you can try reducing the raft-engine.purge-threshold.

| username: 霸王龙的日常 | Original post link

After deletion, TiKV malfunctioned.

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

TiKV’s underlying structure consists of two RocksDB instances: one for storing Raft logs and the other for storing data. When TiKV writes data, it first uses the Raft log to ensure data consistency among different TiKV nodes, as the Raft protocol records the logs. If you find that there are too many logs, there are several parameters that can be modified.

| username: DBAER | Original post link

This raft log is the WAL log.

| username: lemonade010 | Original post link

How large is considered large? There should be a limit and some repeated writes, so it shouldn’t be too large.

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

I see that your space only occupies 2.9G, right?

| username: dba远航 | Original post link

This is a data log, it cannot be tampered with.

| username: zhanggame1 | Original post link

The raft log is not, the wal is from RocksDB.

| username: zhanggame1 | Original post link

The default maximum limit is 4GB, which I think is not small at all.

| username: 小于同学 | Original post link

Cannot be deleted

| username: system | Original post link

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