aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Lebedev <lebedev_k@tochka.com>2021-03-11 23:34:36 +0500
committerKonstantin Lebedev <lebedev_k@tochka.com>2021-03-11 23:34:36 +0500
commit58cdcc6d6eb13dd6c887cb7766aa7e4273c6051d (patch)
tree640a887d47a5c2a63eae178d09555bf55291517a
parent4db21012c1604d535420d4a892c06daecb795c1f (diff)
downloadseaweedfs-58cdcc6d6eb13dd6c887cb7766aa7e4273c6051d.tar.xz
seaweedfs-58cdcc6d6eb13dd6c887cb7766aa7e4273c6051d.zip
error if urls not found
-rw-r--r--weed/filer/stream.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/weed/filer/stream.go b/weed/filer/stream.go
index 292e41f82..573ab65e8 100644
--- a/weed/filer/stream.go
+++ b/weed/filer/stream.go
@@ -26,6 +26,9 @@ func StreamContent(masterClient wdclient.HasLookupFileIdFunction, w io.Writer, c
if err != nil {
glog.V(1).Infof("operation LookupFileId %s failed, err: %v", chunkView.FileId, err)
return err
+ } else if len(urlStrings) == 0 {
+ glog.Errorf("operation LookupFileId %s failed, err: urls not found", chunkView.FileId)
+ return fmt.Errorf("operation LookupFileId %s failed, err: urls not found", chunkView.FileId)
}
fileId2Url[chunkView.FileId] = urlStrings
}
@@ -38,12 +41,6 @@ func StreamContent(masterClient wdclient.HasLookupFileIdFunction, w io.Writer, c
if err != nil {
glog.Errorf("read chunk: %v", err)
return fmt.Errorf("read chunk: %v", err)
- } else if len(data) == 0 {
- glog.Errorf("data size zero read chunk: %s", urlStrings)
- return fmt.Errorf("data size zero read chunk: %s", urlStrings)
- } else if len(chunkViews) == 1 && int64(len(data)) != size {
- glog.Errorf("data size not eq %i read chunk: %s", size, urlStrings)
- return fmt.Errorf("data size not eq %i read chunk: %s", size, urlStrings)
}
_, err = w.Write(data)