From e6ab4db6b8499f58235c861320122c10967e145b Mon Sep 17 00:00:00 2001 From: poornas Date: Thu, 24 Sep 2020 12:25:41 -0700 Subject: [PATCH] Fix minimum replication workers started (#10560) This PR also fixes GetReplicationConfiguration permission in web-handlers.go to use bucket as resource --- cmd/bucket-replication.go | 5 +++++ cmd/web-handlers.go | 2 +- docs/bucket/replication/README.md | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/bucket-replication.go b/cmd/bucket-replication.go index 33a193a2b..e0c96df01 100644 --- a/cmd/bucket-replication.go +++ b/cmd/bucket-replication.go @@ -304,6 +304,11 @@ var ( ) func newReplicationState() *replicationState { + + // fix minimum concurrent replication to 1 for single CPU setup + if globalReplicationConcurrent == 0 { + globalReplicationConcurrent = 1 + } rs := &replicationState{ replicaCh: make(chan ObjectInfo, globalReplicationConcurrent*2), } diff --git a/cmd/web-handlers.go b/cmd/web-handlers.go index a27def091..94349bd31 100644 --- a/cmd/web-handlers.go +++ b/cmd/web-handlers.go @@ -1025,7 +1025,7 @@ func (web *webAPIHandlers) Upload(w http.ResponseWriter, r *http.Request) { BucketName: bucket, ConditionValues: getConditionValues(r, "", claims.AccessKey, claims.Map()), IsOwner: owner, - ObjectName: object, + ObjectName: "", Claims: claims.Map(), }) { replPerms = ErrNone diff --git a/docs/bucket/replication/README.md b/docs/bucket/replication/README.md index e6ef30463..f953d546e 100644 --- a/docs/bucket/replication/README.md +++ b/docs/bucket/replication/README.md @@ -129,6 +129,8 @@ Replication status can be seen in the metadata on the source and destination obj To perform bi-directional replication, repeat the above process on the target site - this time setting the source bucket as the replication target. +It is recommended that replication be run in a system with atleast two CPU's available to the process, so that replication can run in its own thread. + ![put](https://raw.githubusercontent.com/minio/minio/master/docs/bucket/replication/PUT_bucket_replication.png) ![head](https://raw.githubusercontent.com/minio/minio/master/docs/bucket/replication/HEAD_bucket_replication.png)