mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Merge pull request #335 from hxiaodon/master
fix bug when choosing the healthy master in filer service
This commit is contained in:
commit
8dfe22ef1c
|
@ -73,7 +73,10 @@ func NewFilerServer(r *http.ServeMux, ip string, port int, master string, dir st
|
||||||
glog.V(0).Infof("Filer server bootstraps with master %s", fs.getMasterNode())
|
glog.V(0).Infof("Filer server bootstraps with master %s", fs.getMasterNode())
|
||||||
|
|
||||||
//force initialize with all available master nodes
|
//force initialize with all available master nodes
|
||||||
fs.masterNodes.FindMaster()
|
_, err := fs.masterNodes.FindMaster()
|
||||||
|
if err != nil {
|
||||||
|
glog.Fatalf("filer server failed to get master cluster info:%s", err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
for {
|
for {
|
||||||
glog.V(4).Infof("Filer server sending to master %s", fs.getMasterNode())
|
glog.V(4).Infof("Filer server sending to master %s", fs.getMasterNode())
|
||||||
|
@ -127,7 +130,7 @@ func (fs *FilerServer) detectHealthyMaster(masterNode string) (master string, e
|
||||||
if e != nil {
|
if e != nil {
|
||||||
continue
|
continue
|
||||||
} else {
|
} else {
|
||||||
if e = checkMaster(masterNode); e == nil {
|
if e = checkMaster(master); e == nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue