Merge pull request #834 from bingoohuang/patch-1

fail fast when failed to write local volume
This commit is contained in:
Chris Lu 2019-01-15 00:02:46 -08:00 committed by GitHub
commit 7081261fca
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()
}