serialize replication and feed it through task model (#10500)

this allows for eventually controlling the concurrency
of replication and overally control of throughput
This commit is contained in:
Harshavardhana
2020-09-16 16:04:55 -07:00
committed by GitHub
parent 24cab7f9df
commit d616d8a857
6 changed files with 107 additions and 60 deletions
+2 -9
View File
@@ -1166,16 +1166,9 @@ func (web *webAPIHandlers) Upload(w http.ResponseWriter, r *http.Request) {
}
}
if mustReplicate {
go replicateObject(GlobalContext, bucket, object, objInfo.VersionID, objectAPI, &eventArgs{
EventName: event.ObjectCreatedPut,
BucketName: bucket,
Object: objInfo,
ReqParams: extractReqParams(r),
RespElements: extractRespElements(w),
UserAgent: r.UserAgent(),
Host: handlers.GetSourceIP(r),
}, false)
globalReplicationState.queueReplicaTask(objInfo)
}
// Notify object created event.
sendEvent(eventArgs{
EventName: event.ObjectCreatedPut,