hashicorp/raft

how to disable snapshot ?

deceive3w opened this issue · 2 comments

snapshot is not needed in my case because we have a final log state in DB, we just needed to re-apply event that's is greater than our final log in db

Hi @deceive3w,

You could set SnapshotInterval or SnapshotThreshold to very high values, but then your problem would be that log compaction would never happen. In Vault we had the same issue, because our boltdb-based FSM obviates the need for making regular snapshots to disk. We implemented a SnapshotStore whose Create method doesn't really do anything: https://github.com/hashicorp/vault/blob/main/physical/raft/snapshot.go#L109-L109

Only for user-initiated snapshot requests do we actually go and read through the FSM and build a snapshot.

Does this answer your question?

Hi @deceive3w,

You could set SnapshotInterval or SnapshotThreshold to very high values, but then your problem would be that log compaction would never happen. In Vault we had the same issue, because our boltdb-based FSM obviates the need for making regular snapshots to disk. We implemented a SnapshotStore whose Create method doesn't really do anything: https://github.com/hashicorp/vault/blob/main/physical/raft/snapshot.go#L109-L109

Only for user-initiated snapshot requests do we actually go and read through the FSM and build a snapshot.

Does this answer your question?

Thanks @ncabatoff.