aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-06-12 21:11:26 -0700
committerChris Lu <chris.lu@gmail.com>2018-06-12 21:11:26 -0700
commit4433b4c006ff8174c4c126c45889921a9b519ab9 (patch)
tree5d3bbad6fea27a76502a4cbdc1d0ad494656b26e
parent03f50180f3f6bfca5ae61fab0fa1c3b1db939e05 (diff)
downloadseaweedfs-4433b4c006ff8174c4c126c45889921a9b519ab9.tar.xz
seaweedfs-4433b4c006ff8174c4c126c45889921a9b519ab9.zip
treat 0 sized file as normal
fix https://github.com/chrislusf/seaweedfs/issues/409
-rw-r--r--weed/topology/store_replicate.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/weed/topology/store_replicate.go b/weed/topology/store_replicate.go
index 1163c68d2..42ad5bf10 100644
--- a/weed/topology/store_replicate.go
+++ b/weed/topology/store_replicate.go
@@ -28,12 +28,10 @@ func ReplicatedWrite(masterNode string, s *storage.Store,
needToReplicate := !s.HasVolume(volumeId)
if err != nil {
errorStatus = "Failed to write to local disk (" + err.Error() + ")"
- } else if ret > 0 {
- needToReplicate = needToReplicate || s.GetVolume(volumeId).NeedToReplicate()
} else {
- errorStatus = "Failed to write to local disk"
+ needToReplicate = needToReplicate || s.GetVolume(volumeId).NeedToReplicate()
}
- if !needToReplicate && ret > 0 {
+ if !needToReplicate {
needToReplicate = s.GetVolume(volumeId).NeedToReplicate()
}
if needToReplicate { //send to other replica locations