From a3b4199e9be442c40f190ec9e0b94e92568089d6 Mon Sep 17 00:00:00 2001 From: Krishna Srinivas Date: Thu, 1 Sep 2016 04:31:32 +0530 Subject: [PATCH] FS/Multipart: Allow for parallel uploads of parts with same part number. (#2587) CBL client does not close connection when the backup process is stopped, this causes read() on the stream on the server side to block and hence the lock held on the part is not released. When the backup process is restarted, we again try to lock on the part and this will block. Using a unique tmp name and not locking it fixes the problem. --- cmd/fs-v1-multipart.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cmd/fs-v1-multipart.go b/cmd/fs-v1-multipart.go index a65a02704..0eff2f38b 100644 --- a/cmd/fs-v1-multipart.go +++ b/cmd/fs-v1-multipart.go @@ -412,12 +412,8 @@ func (fs fsObjects) PutObjectPart(bucket, object, uploadID string, partID int, s return "", InvalidUploadID{UploadID: uploadID} } - // Hold write lock on the part so that there is no parallel upload on the part. - nsMutex.Lock(minioMetaBucket, pathJoin(mpartMetaPrefix, bucket, object, uploadID, strconv.Itoa(partID))) - defer nsMutex.Unlock(minioMetaBucket, pathJoin(mpartMetaPrefix, bucket, object, uploadID, strconv.Itoa(partID))) - partSuffix := fmt.Sprintf("object%d", partID) - tmpPartPath := path.Join(tmpMetaPrefix, uploadID+"-"+partSuffix) + tmpPartPath := path.Join(tmpMetaPrefix, uploadID+"."+getUUID()+"."+partSuffix) // Initialize md5 writer. md5Writer := md5.New()