mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fix volume_layout bug, add new feature for volume etag write,filer pass through query params'
This commit is contained in:
parent
b617b13c43
commit
079fdbad13
|
@ -70,6 +70,13 @@ func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request,
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
u, _ := url.Parse(urlString)
|
u, _ := url.Parse(urlString)
|
||||||
|
q := u.Query()
|
||||||
|
for key, values := range r.URL.Query() {
|
||||||
|
for _, value := range values {
|
||||||
|
q.Add(key, value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
u.RawQuery = q.Encode()
|
||||||
request := &http.Request{
|
request := &http.Request{
|
||||||
Method: r.Method,
|
Method: r.Method,
|
||||||
URL: u,
|
URL: u,
|
||||||
|
|
|
@ -42,6 +42,8 @@ func (vs *VolumeServer) PostHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
ret.Name = string(needle.Name)
|
ret.Name = string(needle.Name)
|
||||||
}
|
}
|
||||||
ret.Size = size
|
ret.Size = size
|
||||||
|
etag := needle.Etag()
|
||||||
|
w.Header().Set("Etag", etag)
|
||||||
writeJsonQuiet(w, r, httpStatus, ret)
|
writeJsonQuiet(w, r, httpStatus, ret)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,11 +79,11 @@ func (vl *VolumeLayout) addToWritable(vid storage.VolumeId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (vl *VolumeLayout) isOversized(v *storage.VolumeInfo) bool {
|
func (vl *VolumeLayout) isOversized(v *storage.VolumeInfo) bool {
|
||||||
return uint64(v.Size) < vl.volumeSizeLimit
|
return uint64(v.Size) >= vl.volumeSizeLimit
|
||||||
}
|
}
|
||||||
|
|
||||||
func (vl *VolumeLayout) isWritable(v *storage.VolumeInfo) bool {
|
func (vl *VolumeLayout) isWritable(v *storage.VolumeInfo) bool {
|
||||||
return vl.isOversized(v) &&
|
return !vl.isOversized(v) &&
|
||||||
v.Version == storage.CurrentVersion &&
|
v.Version == storage.CurrentVersion &&
|
||||||
!v.ReadOnly
|
!v.ReadOnly
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue