Skip to content

Commit

Permalink
Fix complete MPU with missing parts
Browse files Browse the repository at this point in the history
Issue: CLDSRV-570
  • Loading branch information
KillianG committed Oct 29, 2024
1 parent ec2e304 commit fc9312b
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions lib/api/completeMultipartUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,29 @@ function completeMultipartUpload(authInfo, request, log, callback) {
});
return next(err, destBucket);
}
return next(null, destBucket, dataLocations,
return next(null, destBucket, extraPartLocations, dataLocations,
metaStoreParams, mpuBucket, keysToDelete, aggregateETag,
objMD, extraPartLocations, pseudoCipherBundle,
completeObjData, options);
objMD, pseudoCipherBundle, completeObjData, options);
});
},
function batchDeleteExtraParts(destinationBucket, extraPartLocations,
dataLocations, metaStoreParams, mpuBucket, keysToDelete,
aggregateETag, objMD, pseudoCipherBundle, completeObjData, options, next) {
if (extraPartLocations && extraPartLocations.length > 0) {
return data.batchDelete(extraPartLocations, request.method, null, log,
err => {
if (err) {
return next(err);
}
return next(null, destinationBucket,
dataLocations, metaStoreParams, mpuBucket, keysToDelete,
aggregateETag, objMD, extraPartLocations, pseudoCipherBundle, completeObjData, options);
});
}
return next(null, destinationBucket, dataLocations, metaStoreParams,
mpuBucket, keysToDelete, aggregateETag, objMD, extraPartLocations, pseudoCipherBundle,
completeObjData, options);
},
function storeAsNewObj(destinationBucket, dataLocations,
metaStoreParams, mpuBucket, keysToDelete, aggregateETag, objMD,
extraPartLocations, pseudoCipherBundle,
Expand Down Expand Up @@ -481,36 +498,20 @@ function completeMultipartUpload(authInfo, request, log, callback) {
return next(err);
}
return next(null, mpuBucket, keysToDelete,
aggregateETag, extraPartLocations,
aggregateETag,
destinationBucket, generatedVersionId);
});
}
return next(null, mpuBucket, keysToDelete, aggregateETag,
extraPartLocations, destinationBucket,
generatedVersionId);
destinationBucket, generatedVersionId);
});
},
function deletePartsMetadata(mpuBucket, keysToDelete, aggregateETag,
extraPartLocations, destinationBucket, generatedVersionId, next) {
destinationBucket, generatedVersionId, next) {
services.batchDeleteObjectMetadata(mpuBucket.getName(),
keysToDelete, log, err => next(err, extraPartLocations,
keysToDelete, log, err => next(err,
destinationBucket, aggregateETag, generatedVersionId));
},
function batchDeleteExtraParts(extraPartLocations, destinationBucket,
aggregateETag, generatedVersionId, next) {
if (extraPartLocations && extraPartLocations.length > 0) {
return data.batchDelete(extraPartLocations, request.method,
null, log, err => {
if (err) {
return next(err);
}
return next(null, destinationBucket, aggregateETag,
generatedVersionId);
});
}
return next(null, destinationBucket, aggregateETag,
generatedVersionId);
},
], (err, destinationBucket, aggregateETag, generatedVersionId) => {
const corsHeaders =
collectCorsHeaders(request.headers.origin, request.method,
Expand Down

0 comments on commit fc9312b

Please sign in to comment.