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
fix(filer): propagate proxyChunkId query params to volume server (#10036)
MorezMartin6f1d4af035e2
diff --git a/weed/server/filer_server_handlers.go b/weed/server/filer_server_handlers.goindex 2fa9dee37f..3062c3f722 100644--- a/weed/server/filer_server_handlers.go+++ b/weed/server/filer_server_handlers.go@@ -58,8 +58,8 @@ func (fs *FilerServer) filerHandler(w http.ResponseWriter, r *http.Request) {// proxy to volume serversvar fileId string- if strings.HasPrefix(r.RequestURI, "/?proxyChunkId=") {- fileId = r.RequestURI[len("/?proxyChunkId="):]+ if r.URL.Path == "/" {+ fileId = r.URL.Query().Get("proxyChunkId")}if fileId != "" {fs.proxyToVolumeServer(w, r, fileId)diff --git a/weed/server/filer_server_handlers_proxy.go b/weed/server/filer_server_handlers_proxy.goindex cdbb953215..ae73c88b1d 100644--- a/weed/server/filer_server_handlers_proxy.go+++ b/weed/server/filer_server_handlers_proxy.go@@ -61,9 +61,19 @@ func (fs *FilerServer) proxyToVolumeServer(w http.ResponseWriter, r *http.Requesreturn}- proxyReq, err := http.NewRequest(r.Method, urlStrings[rand.IntN(len(urlStrings))], r.Body)+ // urlStrings from LookupFileId already contain the fileId in the path+ // (e.g. http://server:8080/6,08136bdce4). Forward the caller's query params+ // (e.g. readDeleted=true from weed mount) but drop the internal proxyChunkId.+ targetURL := urlStrings[rand.IntN(len(urlStrings))]+ query := r.URL.Query()+ query.Del("proxyChunkId")+ if encoded := query.Encode(); encoded != "" {+ targetURL += "?" + encoded+ }++ proxyReq, err := http.NewRequest(r.Method, targetURL, r.Body)if err != nil {- glog.ErrorfCtx(ctx, "NewRequest %s: %v", urlStrings[0], err)+ glog.ErrorfCtx(ctx, "NewRequest %s: %v", targetURL, err)w.WriteHeader(http.StatusInternalServerError)return}