CLDSRV-925: UploadPartCopy handle checksums#6188
Conversation
Hello leif-scality,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Incorrect fix versionThe
Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:
Please check the |
❌ 1 Tests Failed:
View the full list of 1 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
213b6f9 to
c216f9e
Compare
|
LGTM |
dc11eca to
bb17208
Compare
|
1aef129 to
4e842be
Compare
| const algo = mpuOverviewMD.checksumAlgorithm; | ||
| const recompute = algo && _shouldRecomputeChecksum(request, sourceObjMD.checksum, algo); | ||
| // External backends need their own MPU API, so _copyPartStreamingWithChecksum (data.put) can't be used. | ||
| const destIsExternal = constants.externalBackends[ | ||
| config.getLocationConstraintType(destObjLocationConstraint)]; | ||
| if (recompute && dataLocator.length > 0 && !destIsExternal) { | ||
| return _copyPartStreamingWithChecksum(dataLocator, copyObjectSize, sse, | ||
| destObjLocationConstraint, dataStoreContext, algo, log, (err, result) => { | ||
| // eslint-disable-next-line no-param-reassign | ||
| request.actionImplicitDenies = originalIdentityAuthzResults; | ||
| if (err) { | ||
| // eslint-disable-next-line no-param-reassign | ||
| request.sourceServerAccessLog && (request.sourceServerAccessLog.error = err); | ||
| return next(err, destBucketMD); | ||
| } | ||
| return next(null, destBucketMD, result.locations, result.totalHash, copyObjectSize, | ||
| sourceVerId, sse, new Date().toJSON(), splitter, mpuOverviewMD, result.checksum); | ||
| }); |
There was a problem hiding this comment.
Do we know how much time do we spend here? How many milliseconds do we add?
There was a problem hiding this comment.
No. There is a task open to measure the cost of checksums, it is going to be done next
44c9f14 to
cd1d2ad
Compare
| sourceIsDestination && | ||
| whichMetadata === 'COPY' && | ||
| Object.keys(overrideMetadata).length === 0 && | ||
| !headers['x-amz-checksum-algorithm'] && |
There was a problem hiding this comment.
This means we will do the copy even if the source object already has the requested checksum (and we requested the same algorithm, so no change in the checksum), right?
Is this what AWS does?
Should we instead use _shouldRecomputeChecksum?
There was a problem hiding this comment.
The original guard change was wrong. I checked AWS on a bucket with Bucket Keys turned on, where every self-copy looks like an encryption change so they all succeed; on a normal bucket AWS rejects a COPY self-copy that only sets a checksum and needs MetadataDirective=REPLACE instead.
The commit was changed and I only added a unit test to verify we follow the AWS behaviour
…m change (match AWS)
…nds match UploadPart behaviour
cd1d2ad to
5cd6b29
Compare
There was a problem hiding this comment.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
|
/approve |
Incorrect fix versionThe
Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:
Please check the The following options are set: approve |
|
ping |
|
I have successfully merged the changeset of this pull request
The following branches have NOT changed:
This pull request did not target the following hotfix branch(es) so they
Please check the status of the associated issue CLDSRV-925. Goodbye leif-scality. The following options are set: approve |
UploadPartCopy — when the checksum is recomputed vs reused vs skipped
copy-source-rangepresentUploadPart