Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

filer: retryable when error is not found

chrisluaac45f3e89a2
diff --git a/weed/server/volume_server_handlers_read.go b/weed/server/volume_server_handlers_read.go
index 4208dd4fc2..4a20bba38a 100644
--- a/weed/server/volume_server_handlers_read.go
+++ b/weed/server/volume_server_handlers_read.go
@@ -143,7 +143,11 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)
// glog.V(4).Infoln("read bytes", count, "error", err)
if err != nil || count < 0 {
glog.V(3).Infof("read %s isNormalVolume %v error: %v", r.URL.Path, hasVolume, err)
- w.WriteHeader(http.StatusNotFound)
+ if err == storage.ErrorNotFound || err == storage.ErrorDeleted {
+ w.WriteHeader(http.StatusNotFound)
+ } else {
+ w.WriteHeader(http.StatusInternalServerError)
+ }
return
}
if n.Cookie != cookie {
diff --git a/weed/util/http_util.go b/weed/util/http_util.go
index 00dac26f74..783ff23797 100644
--- a/weed/util/http_util.go
+++ b/weed/util/http_util.go
@@ -309,7 +309,7 @@ func ReadUrlAsStream(fileUrl string, cipherKey []byte, isContentGzipped bool, is
}
defer CloseResponse(r)
if r.StatusCode >= 400 {
- retryable = r.StatusCode >= 500
+ retryable = r.StatusCode == http.StatusNotFound || r.StatusCode >= 500
return retryable, fmt.Errorf("%s: %s", fileUrl, r.Status)
}