added proper log messages
This commit is contained in:
@@ -158,7 +158,7 @@ func PostHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
needToReplicate := !store.HasVolume(volumeId)
|
needToReplicate := !store.HasVolume(volumeId)
|
||||||
if ret > 0 {
|
if ret > 0 {
|
||||||
needToReplicate = needToReplicate || store.GetVolume(volumeId).NeedToReplicate()
|
needToReplicate = needToReplicate || store.GetVolume(volumeId).NeedToReplicate()
|
||||||
}else{
|
} else {
|
||||||
errorStatus = "Failed to write to local disk"
|
errorStatus = "Failed to write to local disk"
|
||||||
}
|
}
|
||||||
if !needToReplicate && ret > 0 {
|
if !needToReplicate && ret > 0 {
|
||||||
@@ -316,8 +316,19 @@ func runVolume(cmd *Command, args []string) bool {
|
|||||||
http.HandleFunc("/admin/vacuum_volume_commit", vacuumVolumeCommitHandler)
|
http.HandleFunc("/admin/vacuum_volume_commit", vacuumVolumeCommitHandler)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
|
connected := true
|
||||||
for {
|
for {
|
||||||
store.Join(*masterNode)
|
err := store.Join(*masterNode)
|
||||||
|
if err == nil {
|
||||||
|
if !connected {
|
||||||
|
connected = true
|
||||||
|
log.Println("Reconnected with master")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if connected {
|
||||||
|
connected = false
|
||||||
|
}
|
||||||
|
}
|
||||||
time.Sleep(time.Duration(float32(*vpulse*1e3)*(1+rand.Float32())) * time.Millisecond)
|
time.Sleep(time.Duration(float32(*vpulse*1e3)*(1+rand.Float32())) * time.Millisecond)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ func vacuumVolume_Check(urlLocation string, vid storage.VolumeId, garbageThresho
|
|||||||
values.Add("garbageThreshold", garbageThreshold)
|
values.Add("garbageThreshold", garbageThreshold)
|
||||||
jsonBlob, err := util.Post("http://"+urlLocation+"/admin/vacuum_volume_check", values)
|
jsonBlob, err := util.Post("http://"+urlLocation+"/admin/vacuum_volume_check", values)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
fmt.Println("parameters:",values)
|
||||||
return err, false
|
return err, false
|
||||||
}
|
}
|
||||||
var ret VacuumVolumeResult
|
var ret VacuumVolumeResult
|
||||||
|
|||||||
Reference in New Issue
Block a user