reporting volume size as early as possible

This commit is contained in:
Chris Lu
2012-12-03 22:54:08 -08:00
parent b3df7673ed
commit 6201ed537e
6 changed files with 74 additions and 38 deletions

View File

@@ -114,6 +114,9 @@ func dirJoinHandler(w http.ResponseWriter, r *http.Request) {
json.Unmarshal([]byte(r.FormValue("volumes")), volumes)
debug(s, "volumes", r.FormValue("volumes"))
topo.RegisterVolumes(*volumes, ip, port, publicUrl, maxVolumeCount)
m := make(map[string]interface{})
m["VolumeSizeLimit"] = uint64(*volumeSizeLimitMB)*1024*1024
writeJson(w, r, m)
}
func dirStatusHandler(w http.ResponseWriter, r *http.Request) {

View File

@@ -317,8 +317,9 @@ func runVolume(cmd *Command, args []string) bool {
go func() {
connected := true
store.SetMaster(*masterNode)
for {
err := store.Join(*masterNode)
err := store.Join()
if err == nil {
if !connected {
connected = true