Skip to content

Commit d8c874c

Browse files
fix concurrent mpu duplicate objects bug
Issue : ARSN-513
1 parent 55b4425 commit d8c874c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/storage/metadata/mongoclient/MongoClientInterface.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,13 @@ class MongoClientInterface {
12191219
return this.putObjectNoVerWithOplogUpdate(collection, bucketName, objName, value, params, log, cb);
12201220
}
12211221
const key = formatMasterKey(objName, params.vFormat);
1222-
const putFilter = { _id: key };
1222+
const putFilter = {
1223+
_id: key,
1224+
// Related issue : https://scality.atlassian.net/jira/software/c/projects/OS/boards/268?selectedIssue=CLDSRV-687
1225+
// If completeMultipartUpload is called twice with the same parameters, the second will fail with this filter,
1226+
// stopping the code from creating duplicate objects
1227+
'value.completeInProgress': { $ne: true },
1228+
};
12231229
return collection.updateOne(putFilter, {
12241230
$set: {
12251231
_id: key,

0 commit comments

Comments
 (0)