diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-10-19 00:12:42 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-10-19 00:12:42 -0700 |
| commit | 69f0da5d73b6f681b2313e3230a39e254693f453 (patch) | |
| tree | e60cd9ca1b38f6ef648043e954898084f429a0c7 | |
| parent | da6b9e673b3ab1cfe87db40eb7eff540316f8b13 (diff) | |
| download | seaweedfs-69f0da5d73b6f681b2313e3230a39e254693f453.tar.xz seaweedfs-69f0da5d73b6f681b2313e3230a39e254693f453.zip | |
mount: pass along replication and collection parameters
| -rw-r--r-- | weed/filesys/wfs_write.go | 2 | ||||
| -rw-r--r-- | weed/server/filer_server_handlers_write.go | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/weed/filesys/wfs_write.go b/weed/filesys/wfs_write.go index e7db31203..27b2297ed 100644 --- a/weed/filesys/wfs_write.go +++ b/weed/filesys/wfs_write.go @@ -65,6 +65,6 @@ func (wfs *WFS) saveDataAsChunk(dir string) filer.SaveDataAsChunkFunctionType { wfs.chunkCache.SetChunk(fileId, data) chunk = uploadResult.ToPbFileChunk(fileId, offset) - return chunk, "", "", nil + return chunk, collection, replication, nil } } diff --git a/weed/server/filer_server_handlers_write.go b/weed/server/filer_server_handlers_write.go index 0091ae3ce..584ab9823 100644 --- a/weed/server/filer_server_handlers_write.go +++ b/weed/server/filer_server_handlers_write.go @@ -139,6 +139,7 @@ func (fs *FilerServer) detectCollection(requestURI, qCollection, qReplication st } // required by buckets folder + bucketDefaultReplication := "" if strings.HasPrefix(requestURI, fs.filer.DirBucketsPath+"/") { bucketAndObjectKey := requestURI[len(fs.filer.DirBucketsPath)+1:] t := strings.Index(bucketAndObjectKey, "/") @@ -148,7 +149,10 @@ func (fs *FilerServer) detectCollection(requestURI, qCollection, qReplication st if t > 0 { collection = bucketAndObjectKey[:t] } - replication, fsync = fs.filer.ReadBucketOption(collection) + bucketDefaultReplication, fsync = fs.filer.ReadBucketOption(collection) + } + if replication == "" { + replication = bucketDefaultReplication } return |
