mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
fix(standby_server): able to join the cluster containing itself
Standby server will switch to peer server if it finds that it has been contained in the cluster.
This commit is contained in:
@@ -235,6 +235,13 @@ func (s *StandbyServer) syncCluster(peerURLs []string) error {
|
||||
}
|
||||
|
||||
func (s *StandbyServer) join(peer string) error {
|
||||
for _, url := range s.ClusterURLs() {
|
||||
if s.Config.PeerURL == url {
|
||||
s.joinIndex = 0
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// Our version must match the leaders version
|
||||
version, err := s.client.GetVersion(peer)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user