fail fast when failed to write local volume

This commit is contained in:
bingoohuang 2019-01-15 15:47:43 +08:00 committed by GitHub
parent 2ff95ead57
commit 219838db87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,9 +28,11 @@ func ReplicatedWrite(masterNode string, s *storage.Store,
needToReplicate := !s.HasVolume(volumeId)
if err != nil {
errorStatus = "Failed to write to local disk (" + err.Error() + ")"
} else {
needToReplicate = needToReplicate || s.GetVolume(volumeId).NeedToReplicate()
size = ret
return
}
needToReplicate = needToReplicate || s.GetVolume(volumeId).NeedToReplicate()
if !needToReplicate {
needToReplicate = s.GetVolume(volumeId).NeedToReplicate()
}