Skip to content
Open
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
9 changes: 4 additions & 5 deletions lib/api/apiUtils/bucket/updateEncryption.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,17 @@ function updateObjectEncryption(bucket, objMD, objectKey, log, keyArnPrefix, opt
dataLocator.masterKeyId = `${keyArnPrefix}${dataLocator.masterKeyId}`;
}
}
// Reformating the key arn is not an operation that should trigger any
// oplog driven logic (CRR, bucket notifications).
// eslint-disable-next-line no-param-reassign
objMD.originOp = 's3:ObjectCreated:Copy';
// Copy should be tested for 9.5 in INTGR-1038

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BourgoisMickael On this old ticket : https://scality.atlassian.net/browse/INTGR-1038

you wrote a comment "It will trigger new bucket notification, but it will not trigger a replication for CRR"

With this change, it will not trigger bucket notif anymore. But I think you have integration tests that may expect it, so I'm letting you know you may have to update your tests

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did that to follow the AWS way of updating the encryption: you do a copy of the object on itself while changing the encryption in metadata.

This is an internal operation but follows the way a user would do.

I can't find that actionUpdateObjectEncryption in the bucket notification documentation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well that's the point 🤔 actionUpdateObjectEncryption is not in the list of notifications, so it wont trigger a notif unlike the existing ObjectCreated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I though we wanted to actually receive a notification (even if it's internal change) as the metadata changes.

Is it how it's done in AWS as well ?

Otherwise I'm fine with it. Should this fix ship in development/9.4 ?

// to make sure it does not impact backbeat CRR / bucket notif
objMD.originOp = 's3:UpdateObjectEncryption';
const params = getVersionSpecificMetadataOptions(objMD, config.nullVersionCompatMode);

log.info('reformating object encryption key', { oldKey: key, newKey, skipUpdate: opts.skipObjectUpdate });
if (opts.skipObjectUpdate) {
return cb(null, bucket, objMD);
}
return metadata.putObjectMD(bucket.getName(), objectKey, objMD, params,
log, err => cb(err, bucket, objMD));
return metadata.putObjectMD(bucket.getName(), objectKey, objMD, params, log, err => cb(err, bucket, objMD));
}

/**
Expand Down
Loading