Browse Source

Merge pull request #126 from yanyiwu/master

FIXED: When RaftServer cannot find a leader, Return a more readable erro...
pull/127/head
chrislusf 10 years ago
parent
commit
d47a6701c6
  1. 7
      go/weed/weed_server/master_server_handlers_admin.go

7
go/weed/weed_server/master_server_handlers_admin.go

@ -133,7 +133,12 @@ func (ms *MasterServer) submitFromMasterServerHandler(w http.ResponseWriter, r *
if ms.Topo.IsLeader() { if ms.Topo.IsLeader() {
submitForClientHandler(w, r, "localhost:"+strconv.Itoa(ms.port)) submitForClientHandler(w, r, "localhost:"+strconv.Itoa(ms.port))
} else { } else {
submitForClientHandler(w, r, ms.Topo.RaftServer.Leader())
masterUrl, err := ms.Topo.Leader()
if err != nil {
writeJsonError(w, r, http.StatusInternalServerError, err)
} else {
submitForClientHandler(w, r, masterUrl)
}
} }
} }

Loading…
Cancel
Save