How to recover from raft.db corrupt except deleting it

the raft.db occassionaly corrupts due to power unplug/plug and we just delete the corrupted raft.db and restart the consul to make it running again. we found this way would make the dns query fails for the existing services. since the service records are kept seperately in a services directory, the deleting of raft.db would not impact the service query. so it is likely that the dns records are kept in the raft.db. in order to avoid other unpredictable failures, I may want to know what other stuffs are stored in the raft.db and what are the corresponding functions? and maybe there is also an official safe way to handle the raft.db corrupt situation?
Can anybody help?

raft.db stores all the data in the Consul cluster that has recently changed.

Then, periodically, a snapshot gets written out to a file in the snapshots/ directory, and raft.db gets trimmed back to only the changes since the most recent snapshot.

Deleting raft.db loses all the changes that haven’t made it to a snapshot yet.

Consul isn’t really intended to be deployed on a system where the underlying storage isn’t reliable. I guess the official way to deal with this would be to remove the node from the cluster, wipe it, and let it rejoin as a new node, and repopulate from other cluster nodes.

Unfortunately, this is one node deployment. :sweat_smile: