aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-10-16 11:02:44 -0700
committerChris Lu <chris.lu@gmail.com>2020-10-16 11:02:44 -0700
commitee1fc6558a6db603c4eaac9f3cee11873f934f56 (patch)
treee5eb5da9fe4563f9f9df3a4da2e768e3187531ee
parent06e63410975077b54ae8e7cd49ac2b33c308ec46 (diff)
downloadseaweedfs-ee1fc6558a6db603c4eaac9f3cee11873f934f56.tar.xz
seaweedfs-ee1fc6558a6db603c4eaac9f3cee11873f934f56.zip
refactor
-rw-r--r--weed/command/master.go2
-rw-r--r--weed/wdclient/masterclient.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/weed/command/master.go b/weed/command/master.go
index bf5f83875..74c170395 100644
--- a/weed/command/master.go
+++ b/weed/command/master.go
@@ -145,7 +145,7 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) {
go func() {
time.Sleep(1500 * time.Millisecond)
if ms.Topo.RaftServer.Leader() == "" && ms.Topo.RaftServer.IsLogEmpty() && isTheFirstOne(myMasterAddress, peers) {
- if ms.MasterClient.FindLeader(myMasterAddress) == "" {
+ if ms.MasterClient.FindLeaderFromOtherPeers(myMasterAddress) == "" {
raftServer.DoJoinCommand()
}
}
diff --git a/weed/wdclient/masterclient.go b/weed/wdclient/masterclient.go
index 7b0f73ce9..60753e582 100644
--- a/weed/wdclient/masterclient.go
+++ b/weed/wdclient/masterclient.go
@@ -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 {
if master == myMasterAddress {
continue