mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
mount: pass along replication and collection parameters
This commit is contained in:
parent
da6b9e673b
commit
69f0da5d73
|
@ -65,6 +65,6 @@ func (wfs *WFS) saveDataAsChunk(dir string) filer.SaveDataAsChunkFunctionType {
|
||||||
wfs.chunkCache.SetChunk(fileId, data)
|
wfs.chunkCache.SetChunk(fileId, data)
|
||||||
|
|
||||||
chunk = uploadResult.ToPbFileChunk(fileId, offset)
|
chunk = uploadResult.ToPbFileChunk(fileId, offset)
|
||||||
return chunk, "", "", nil
|
return chunk, collection, replication, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,6 +139,7 @@ func (fs *FilerServer) detectCollection(requestURI, qCollection, qReplication st
|
||||||
}
|
}
|
||||||
|
|
||||||
// required by buckets folder
|
// required by buckets folder
|
||||||
|
bucketDefaultReplication := ""
|
||||||
if strings.HasPrefix(requestURI, fs.filer.DirBucketsPath+"/") {
|
if strings.HasPrefix(requestURI, fs.filer.DirBucketsPath+"/") {
|
||||||
bucketAndObjectKey := requestURI[len(fs.filer.DirBucketsPath)+1:]
|
bucketAndObjectKey := requestURI[len(fs.filer.DirBucketsPath)+1:]
|
||||||
t := strings.Index(bucketAndObjectKey, "/")
|
t := strings.Index(bucketAndObjectKey, "/")
|
||||||
|
@ -148,7 +149,10 @@ func (fs *FilerServer) detectCollection(requestURI, qCollection, qReplication st
|
||||||
if t > 0 {
|
if t > 0 {
|
||||||
collection = bucketAndObjectKey[:t]
|
collection = bucketAndObjectKey[:t]
|
||||||
}
|
}
|
||||||
replication, fsync = fs.filer.ReadBucketOption(collection)
|
bucketDefaultReplication, fsync = fs.filer.ReadBucketOption(collection)
|
||||||
|
}
|
||||||
|
if replication == "" {
|
||||||
|
replication = bucketDefaultReplication
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue