From 339856eb783d4ba6597609d1dbe50bb575fb08df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9C=8D=E6=99=93=E6=A0=8B?= Date: Thu, 30 Jun 2016 19:54:05 +0800 Subject: [PATCH] fix bug when choosing the healthy master in filer service --- weed/server/filer_server.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/weed/server/filer_server.go b/weed/server/filer_server.go index dfdf25333..1b54f0840 100644 --- a/weed/server/filer_server.go +++ b/weed/server/filer_server.go @@ -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()) //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 { 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 { continue } else { - if e = checkMaster(masterNode); e == nil { + if e = checkMaster(master); e == nil { break } }