consul: Reduce the number of raft snapshots we keep

This commit is contained in:
Armon Dadgar 2014-02-22 10:57:22 -08:00
parent 5e790b02a9
commit e54d8f6c07
1 changed files with 5 additions and 4 deletions

View File

@ -17,6 +17,7 @@ const (
serfLANSnapshot = "serf/local.snapshot"
serfWANSnapshot = "serf/remote.snapshot"
raftState = "raft/"
snapshotsRetained = 2
)
// Server is Consul server which manages the service discovery,
@ -207,7 +208,7 @@ func (s *Server) setupRaft() error {
s.raftStore = store
// Create the snapshot store
snapshots, err := raft.NewFileSnapshotStore(path, 3, s.config.LogOutput)
snapshots, err := raft.NewFileSnapshotStore(path, snapshotsRetained, s.config.LogOutput)
if err != nil {
store.Close()
return err