Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

refactor

Chris Luee1fc6558a6d
diff --git a/weed/command/master.go b/weed/command/master.go
index bf5f838751..74c1703958 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 7b0f73ce93..60753e582a 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