1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-07-02 15:16:51 +02:00
This commit is contained in:
Chris Lu 2020-10-16 11:02:44 -07:00
parent 06e6341097
commit ee1fc6558a
2 changed files with 2 additions and 2 deletions

View file

@ -145,7 +145,7 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) {
go func() { go func() {
time.Sleep(1500 * time.Millisecond) time.Sleep(1500 * time.Millisecond)
if ms.Topo.RaftServer.Leader() == "" && ms.Topo.RaftServer.IsLogEmpty() && isTheFirstOne(myMasterAddress, peers) { if ms.Topo.RaftServer.Leader() == "" && ms.Topo.RaftServer.IsLogEmpty() && isTheFirstOne(myMasterAddress, peers) {
if ms.MasterClient.FindLeader(myMasterAddress) == "" { if ms.MasterClient.FindLeaderFromOtherPeers(myMasterAddress) == "" {
raftServer.DoJoinCommand() raftServer.DoJoinCommand()
} }
} }

View file

@ -52,7 +52,7 @@ func (mc *MasterClient) KeepConnectedToMaster() {
} }
} }
func (mc *MasterClient) FindLeader(myMasterAddress string) (leader string) { func (mc *MasterClient) FindLeaderFromOtherPeers(myMasterAddress string) (leader string) {
for _, master := range mc.masters { for _, master := range mc.masters {
if master == myMasterAddress { if master == myMasterAddress {
continue continue