Pulls down some code for the check loop.

This commit is contained in:
James Phillips 2017-09-06 13:07:42 -07:00
parent 3535652595
commit 084679ab65
No known key found for this signature in database
GPG Key ID: 77183E682AC5FC11
1 changed files with 5 additions and 7 deletions

View File

@ -638,13 +638,6 @@ func (s *Server) joinConsulServer(m serf.Member, parts *metadata.Server) error {
}
}
addr := (&net.TCPAddr{IP: m.Addr, Port: parts.Port}).String()
minRaftProtocol, err := ServerMinRaftProtocol(s.serfLAN.Members())
if err != nil {
return err
}
// Processing ourselves could result in trying to remove ourselves to
// fix up our address, which would make us step down. This is only
// safe to attempt if there are multiple servers available.
@ -664,6 +657,11 @@ func (s *Server) joinConsulServer(m serf.Member, parts *metadata.Server) error {
// but we want to avoid doing that if possible to prevent useless Raft
// log entries. If the address is the same but the ID changed, remove the
// old server before adding the new one.
addr := (&net.TCPAddr{IP: m.Addr, Port: parts.Port}).String()
minRaftProtocol, err := ServerMinRaftProtocol(s.serfLAN.Members())
if err != nil {
return err
}
for _, server := range configFuture.Configuration().Servers {
// No-op if the raft version is too low
if server.Address == raft.ServerAddress(addr) && (minRaftProtocol < 2 || parts.RaftVersion < 3) {