Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of archived object replacement #5678

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions lib/api/apiUtils/object/createAndStoreObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,6 @@ 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 Expand Up @@ -273,6 +268,9 @@ function createAndStoreObject(bucketName, bucketMD, objectKey, objMD, authInfo,
if (isPutVersion) {
const options = overwritingVersioning(objMD, metadataStoreParams);
return process.nextTick(() => next(null, options, infoArr));
} else if (!bucketMD.isVersioningEnabled() && objMD?.archive?.archiveInfo) {
francoisferrand marked this conversation as resolved.
Show resolved Hide resolved
// Ensure we trigger a "delete" event in the oplog for the previously archived object
metadataStoreParams.needOplogUpdate = 's3:ReplaceArchivedObject';
}
return versioningPreprocessing(bucketName, bucketMD,
metadataStoreParams.objectKey, objMD, log, (err, options) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const services = {
}
if (needOplogUpdate) {
options.needOplogUpdate = true;
options.originOp = originOp;
options.originOp = needOplogUpdate;
}
if (uploadId) {
md.setUploadId(uploadId);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zenko/cloudserver",
"version": "8.8.31",
"version": "8.8.32",
"description": "Zenko CloudServer, an open-source Node.js implementation of a server handling the Amazon S3 protocol",
"main": "index.js",
"engines": {
Expand Down
Loading