Skip to content

Commit

Permalink
CLDSRV-548: flag doesNeedOplogUpdate set up
Browse files Browse the repository at this point in the history
  • Loading branch information
benzekrimaha committed Jul 15, 2024
1 parent b72e918 commit f011663
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/api/apiUtils/object/createAndStoreObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ function createAndStoreObject(bucketName, bucketMD, objectKey, objMD, authInfo,
metadataStoreParams.oldReplayId = objMD.uploadId;
}

if (objMD && !bucketMD.isVersioningEnabled() && objMD?.archive?.archiveInfo) {
metadataStoreParams.needOplogUpdate = true;
metadataStoreParams.originOp = 's3:ReplaceArchivedObject';
}

/* eslint-disable camelcase */
const dontSkipBackend = externalBackends;
/* eslint-enable camelcase */
Expand Down
6 changes: 5 additions & 1 deletion lib/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const services = {
tagging, taggingCopy, replicationInfo, defaultRetention,
dataStoreName, creationTime, retentionMode, retentionDate,
legalHold, originOp, updateMicroVersionId, archive, oldReplayId,
deleteNullKey, amzStorageClass, overheadField } = params;
deleteNullKey, amzStorageClass, overheadField, needOplogUpdate } = params;
log.trace('storing object in metadata');
assert.strictEqual(typeof bucketName, 'string');
const md = new ObjectMD();
Expand Down Expand Up @@ -176,6 +176,10 @@ const services = {
if (versionId || versionId === '') {
options.versionId = versionId;
}
if (needOplogUpdate) {
options.needOplogUpdate = true;
options.originOp = originOp;
}
if (uploadId) {
md.setUploadId(uploadId);
options.replayId = uploadId;
Expand Down

0 comments on commit f011663

Please sign in to comment.