mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fix remove deleted peers of raft server
https://github.com/chrislusf/seaweedfs/issues/2804
This commit is contained in:
parent
c1450bf9fe
commit
ddd3945c26
|
@ -119,17 +119,17 @@ func NewRaftServer(option *RaftServerOption) (*RaftServer, error) {
|
|||
exists := false
|
||||
var existingPeer pb.ServerAddress
|
||||
for _, peer := range s.peers {
|
||||
if peer.ToGrpcAddress() == existsPeerName {
|
||||
if peer.String() == existsPeerName {
|
||||
exists, existingPeer = true, peer
|
||||
break
|
||||
}
|
||||
}
|
||||
if exists {
|
||||
if !exists {
|
||||
if err := s.raftServer.RemovePeer(existsPeerName); err != nil {
|
||||
glog.V(0).Infoln(err)
|
||||
return nil, err
|
||||
} else {
|
||||
glog.V(0).Infof("removing old peer %s", existingPeer)
|
||||
glog.V(0).Infof("removing old peer: %s", existingPeer)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue