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.

master: redirect handler accept collection parameter

yangrundb1ac7b3ebac
diff --git a/go/weed/weed_server/master_server_handlers_admin.go b/go/weed/weed_server/master_server_handlers_admin.go
index 2b6ca03203..3834563565 100644
--- a/go/weed/weed_server/master_server_handlers_admin.go
+++ b/go/weed/weed_server/master_server_handlers_admin.go
@@ -121,7 +121,8 @@ func (ms *MasterServer) redirectHandler(w http.ResponseWriter, r *http.Request)
debug("parsing error:", err, r.URL.Path)
return
}
- machines := ms.Topo.Lookup("", volumeId)
+ collection := r.FormValue("collection")
+ machines := ms.Topo.Lookup(collection, volumeId)
if machines != nil && len(machines) > 0 {
var url string
if r.URL.RawQuery != "" {
@@ -131,7 +132,7 @@ func (ms *MasterServer) redirectHandler(w http.ResponseWriter, r *http.Request)
}
http.Redirect(w, r, url, http.StatusMovedPermanently)
} else {
- writeJsonError(w, r, http.StatusNotFound, fmt.Errorf("volume id %d not found", volumeId))
+ writeJsonError(w, r, http.StatusNotFound, fmt.Errorf("volume id %d or collection %s not found", volumeId, collection))
}
}