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) needToReplicate := !s.HasVolume(volumeId)
if err != nil { if err != nil {
errorStatus = "Failed to write to local disk (" + err.Error() + ")" errorStatus = "Failed to write to local disk (" + err.Error() + ")"
} else { size = ret
needToReplicate = needToReplicate || s.GetVolume(volumeId).NeedToReplicate() return
} }
needToReplicate = needToReplicate || s.GetVolume(volumeId).NeedToReplicate()
if !needToReplicate { if !needToReplicate {
needToReplicate = s.GetVolume(volumeId).NeedToReplicate() needToReplicate = s.GetVolume(volumeId).NeedToReplicate()
} }