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.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
prevent empty locations returned
Chris Lu3a5e4769cfe3
diff --git a/weed/server/master_server_handlers.go b/weed/server/master_server_handlers.goindex 514d86800e..ebcb7efd24 100644--- a/weed/server/master_server_handlers.go+++ b/weed/server/master_server_handlers.go@@ -45,7 +45,7 @@ func (ms *MasterServer) dirLookupHandler(w http.ResponseWriter, r *http.Request)vid = fileId[0:commaSep]}}- collection := r.FormValue("collection") //optional, but can be faster if too many collections+ collection := r.FormValue("collection") // optional, but can be faster if too many collectionslocation := ms.findVolumeLocation(collection, vid)httpStatus := http.StatusOKif location.Error != "" || location.Locations == nil {@@ -72,9 +72,6 @@ func (ms *MasterServer) findVolumeLocation(collection, vid string) operation.Loofor _, loc := range machines {locations = append(locations, operation.Location{Url: loc.Url(), PublicUrl: loc.PublicUrl})}- if locations == nil {- err = fmt.Errorf("volume id %s not found", vid)- }}} else {machines, getVidLocationsErr := ms.MasterClient.GetVidLocations(vid)@@ -83,6 +80,9 @@ func (ms *MasterServer) findVolumeLocation(collection, vid string) operation.Loo}err = getVidLocationsErr}+ if len(locations) == 0 && err == nil {+ err = fmt.Errorf("volume id %s not found", vid)+ }ret := operation.LookupResult{VolumeId: vid,Locations: locations,