Compare commits

...

1 Commits

Author SHA1 Message Date
Dimitrios Vasilas 7028866327 WIP 2023-01-18 10:24:16 -05:00
2 changed files with 14 additions and 3 deletions

View File

@ -195,6 +195,10 @@ function createAndStoreObject(bucketName, bucketMD, objectKey, objMD, authInfo,
} }
} }
if (objMD && objMD.uploadId) {
metadataStoreParams.oldReplayId = objMD.uploadId;
}
/* eslint-disable camelcase */ /* eslint-disable camelcase */
const dontSkipBackend = externalBackends; const dontSkipBackend = externalBackends;
/* eslint-enable camelcase */ /* eslint-enable camelcase */

View File

@ -97,7 +97,7 @@ const services = {
lastModifiedDate, versioning, versionId, uploadId, lastModifiedDate, versioning, versionId, uploadId,
tagging, taggingCopy, replicationInfo, defaultRetention, tagging, taggingCopy, replicationInfo, defaultRetention,
dataStoreName, retentionMode, retentionDate, legalHold, dataStoreName, retentionMode, retentionDate, legalHold,
originOp } = params; originOp, oldReplayId } = params;
log.trace('storing object in metadata'); log.trace('storing object in metadata');
assert.strictEqual(typeof bucketName, 'string'); assert.strictEqual(typeof bucketName, 'string');
const md = new ObjectMD(); const md = new ObjectMD();
@ -207,6 +207,10 @@ const services = {
md.setLegalHold(legalHold); md.setLegalHold(legalHold);
} }
if (oldReplayId) {
options.oldReplayId = oldReplayId;
}
log.trace('object metadata', { omVal: md.getValue() }); log.trace('object metadata', { omVal: md.getValue() });
// If this is not the completion of a multipart upload or // If this is not the completion of a multipart upload or
// the creation of a delete marker, parse the headers to // the creation of a delete marker, parse the headers to
@ -273,12 +277,15 @@ const services = {
* @return {undefined} * @return {undefined}
*/ */
deleteObject(bucketName, objectMD, objectKey, options, log, cb) { deleteObject(bucketName, objectMD, objectKey, options, log, cb) {
log.trace('deleting object from bucket');
assert.strictEqual(typeof bucketName, 'string'); assert.strictEqual(typeof bucketName, 'string');
assert.strictEqual(typeof objectMD, 'object'); assert.strictEqual(typeof objectMD, 'object');
function deleteMDandData() { function deleteMDandData() {
return metadata.deleteObjectMD(bucketName, objectKey, options, log, const delOptions = Object.assign({}, options);
if (objectMD.uploadId) {
delOptions.replayId = objectMD.uploadId;
}
return metadata.deleteObjectMD(bucketName, objectKey, delOptions, log,
(err, res) => { (err, res) => {
if (err) { if (err) {
return cb(err, res); return cb(err, res);