mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
Merge pull request #5629 from hbasappa/peersjon
Add support in nomad for supporting raft 3 protocol peers.json
This commit is contained in:
@@ -1169,7 +1169,12 @@ func (s *Server) setupRaft() error {
|
||||
}
|
||||
} else if _, err := os.Stat(peersFile); err == nil {
|
||||
s.logger.Info("found peers.json file, recovering Raft configuration...")
|
||||
configuration, err := raft.ReadPeersJSON(peersFile)
|
||||
var configuration raft.Configuration
|
||||
if s.config.RaftConfig.ProtocolVersion < 3 {
|
||||
configuration, err = raft.ReadPeersJSON(peersFile)
|
||||
} else {
|
||||
configuration, err = raft.ReadConfigJSON(peersFile)
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("recovery failed to parse peers.json: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user