Skip to content

Commit

Permalink
Merge branch 'improvement/CLDSRV-572' into q/7.70
Browse files Browse the repository at this point in the history
  • Loading branch information
bert-e committed Nov 7, 2024
2 parents 9981e50 + a6ddca1 commit 45b48ad
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/routes/routeBackbeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const kms = require('../kms/wrapper');
const { listLifecycleCurrents } = require('../api/backbeat/listLifecycleCurrents');
const { listLifecycleNonCurrents } = require('../api/backbeat/listLifecycleNonCurrents');
const { listLifecycleOrphanDeleteMarkers } = require('../api/backbeat/listLifecycleOrphanDeleteMarkers');
const objectDelete = require('../api/objectDelete');
const { CURRENT_TYPE, NON_CURRENT_TYPE, ORPHAN_DM_TYPE } = constants.lifecycleListing;

const lifecycleTypeCalls = {
Expand Down Expand Up @@ -694,6 +695,23 @@ function putObject(request, response, log, callback) {
});
}

// This method was added to avoid having two different paths in Backbeat when
// expiring an object. In Zenko this function sets the proper originOp to trigger
// an expiration notification. Not supported in S3C as it may add significant load
// with the added metadata update operations.
function deleteObjectFromExpiration(request, response, userInfo, log, callback) {
return objectDelete(userInfo, request, log, err => {
if (err) {
log.error('error deleting object from expiration', {
error: err,
method: 'deleteObjectFromExpiration',
});
return callback(err);
}
return _respond(response, {}, log, callback);
});
}

function deleteObject(request, response, log, callback) {
const err = _checkMultipleBackendRequest(request, log);
if (err) {
Expand Down Expand Up @@ -1199,6 +1217,7 @@ const backbeatRoutes = {
batchdelete: batchDelete,
},
DELETE: {
expiration: deleteObjectFromExpiration,
multiplebackenddata: {
deleteobject: deleteObject,
deleteobjecttagging: deleteObjectTagging,
Expand Down

0 comments on commit 45b48ad

Please sign in to comment.