Skip to content

CLDSRV-925: UploadPartCopy handle checksums#6188

Open
leif-scality wants to merge 6 commits into
development/9.4from
improvement/CLDSRV-925-uploadpartcopy-checksums
Open

CLDSRV-925: UploadPartCopy handle checksums#6188
leif-scality wants to merge 6 commits into
development/9.4from
improvement/CLDSRV-925-uploadpartcopy-checksums

Conversation

@leif-scality

Copy link
Copy Markdown
Contributor

No description provided.

@bert-e

bert-e commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Hello leif-scality,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@bert-e

bert-e commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Incorrect fix version

The Fix Version/s in issue CLDSRV-925 contains:

  • None

Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:

  • 9.4.0

Please check the Fix Version/s of CLDSRV-925, or the target
branch of this pull request.

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

❌ 3 Tests Failed:

Tests completed Failed Passed Skipped
9529 3 9526 0
View the full list of 3 ❄️ flaky test(s)
"after each" hook for "should fail if trying to overwrite a delete marker"::MPU with x-scal-s3-version-id header With default signature "after each" hook for "should fail if trying to overwrite a delete marker"

Flake rate in main: 100.00% (Passed 0 times, Failed 66 times)

Stack Traces | 0.016s run time
We encountered an internal error. Please try again.
"after each" hook for "should fail if trying to overwrite a delete marker"::MPU with x-scal-s3-version-id header With v4 signature "after each" hook for "should fail if trying to overwrite a delete marker"

Flake rate in main: 100.00% (Passed 0 times, Failed 53 times)

Stack Traces | 0.014s run time
We encountered an internal error. Please try again.
"before each" hook for "should retrieve a part copied from an MPU after the original part was overwritten"::GET object With default signature With PartNumber field uploadPartCopy overwrite "before each" hook for "should retrieve a part copied from an MPU after the original part was overwritten"

Flake rate in main: 100.00% (Passed 0 times, Failed 5 times)

Stack Traces | 6.19s run time
Connection timed out after 5000 ms

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@leif-scality leif-scality force-pushed the improvement/CLDSRV-925-uploadpartcopy-checksums branch 3 times, most recently from 213b6f9 to c216f9e Compare June 12, 2026 17:13
@scality scality deleted a comment from claude Bot Jun 12, 2026
@scality scality deleted a comment from claude Bot Jun 12, 2026
@scality scality deleted a comment from claude Bot Jun 12, 2026
@scality scality deleted a comment from claude Bot Jun 12, 2026
@scality scality deleted a comment from claude Bot Jun 12, 2026
@scality scality deleted a comment from claude Bot Jun 12, 2026
@scality scality deleted a comment from claude Bot Jun 12, 2026
@scality scality deleted a comment from claude Bot Jun 12, 2026
@scality scality deleted a comment from claude Bot Jun 12, 2026
@scality scality deleted a comment from claude Bot Jun 12, 2026
@claude

claude Bot commented Jun 15, 2026

Copy link
Copy Markdown

LGTM

Review by Claude Code

@leif-scality leif-scality force-pushed the improvement/CLDSRV-925-uploadpartcopy-checksums branch from dc11eca to bb17208 Compare June 18, 2026 21:47
Comment on lines +26 to +53
(part, cb) => {
const done = jsutil.once(cb);
if (part.dataStoreType === 'azure') {
// Azure's data.get writes part bytes into the provided writable
// instead of returning a Readable. Pipe a per-part PassThrough
// into the master passthrough and use its 'end' as the completion
// signal — same pattern arsenal's data.copyObject uses.
const perPart = new PassThrough();
perPart.once('error', err => done(wrapErr(err, part)));
perPart.once('end', () => done());
perPart.pipe(passthrough, { end: false });
return data.get(part, perPart, log, err => {
if (err) {
perPart.destroy(err);
done(wrapErr(err, part));
}
});
}
return data.get(part, null, log, (err, partStream) => {
if (err) {
return done(wrapErr(err, part));
}
partStream.once('error', err => done(wrapErr(err, part)));
partStream.once('end', () => done());
partStream.pipe(passthrough, { end: false });
return undefined;
});
},
Comment on lines +76 to +87
function computeChecksumFromDataLocator(dataLocator, algorithm, log, cb) {
const onceCb = jsutil.once(cb);
const sourceStream = buildSourcePartsStream(dataLocator || [], log);
const checksumSink = new ChecksumWritable(algorithm, log);
sourceStream.once('error', err => {
checksumSink.destroy(err);
onceCb(err);
});
checksumSink.once('error', onceCb);
checksumSink.once('finish', () => onceCb(null, { algorithm, value: checksumSink.digest }));
sourceStream.pipe(checksumSink);
}
Comment on lines +53 to +104
function _copyPartStreamingWithChecksum(dataLocator, size, sse, destLocationConstraint,
dataStoreContext, algo, log, cb) {
log.debug('recomputing checksum on UploadPartCopy', { algorithm: algo, size });
const wrapChecksumErr = err => Object.assign(err, { checksumStream: { algorithm: algo } });
const backendInfo = new BackendInfo(config, destLocationConstraint);
const sourceStream = buildSourcePartsStream(dataLocator, log);
const checksumStream = new ChecksumTransform(algo, undefined, false, log);
const done = jsutil.once((err, result) => {
if (err) {
sourceStream.destroy(err);
checksumStream.destroy(err);
return cb(err);
}
return cb(null, result);
});
sourceStream.once('error', done);
checksumStream.once('error', err => done(wrapChecksumErr(err)));
sourceStream.pipe(checksumStream);
const doPut = cipherBundle =>
data.put(cipherBundle, checksumStream, size, dataStoreContext, backendInfo, log,
(err, dataRetrievalInfo, hashedStream) => {
if (err) {
return done(err);
}
const location = {
key: dataRetrievalInfo.key,
dataStoreName: dataRetrievalInfo.dataStoreName,
dataStoreETag: hashedStream.completedHash,
size,
};
if (cipherBundle) {
location.sseCryptoScheme = cipherBundle.cryptoScheme;
location.sseCipheredDataKey = cipherBundle.cipheredDataKey;
location.sseAlgorithm = cipherBundle.algorithm;
location.sseMasterKeyId = cipherBundle.masterKeyId;
}
return done(null, {
locations: [location],
totalHash: hashedStream.completedHash,
checksum: { algorithm: algo, value: checksumStream.digest },
});
});
if (sse && sse.algorithm) {
return kms.createCipherBundle(sse, log, (err, cipherBundle) => {
if (err) {
return done(err);
}
return doPut(cipherBundle);
});
}
return doPut(null);
}
const noRange = { headers: {} };
const withRange = { headers: { 'x-amz-copy-source-range': 'bytes=0-1' } };

it('returns true when a copy-source-range is requested', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Test names using it() should start with "should" (e.g. it('should return true when a copy-source-range is requested', ...)). This applies to multiple tests in this file.

— Claude Code

assert.strictEqual(err.name, 'InvalidRequest',
`expected InvalidRequest, got ${err.name}: ${err.message}`);
// AWS names the expected (MPU) and actual (sent) algorithms.
assert(err.message.includes(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Prefer assert.match over assert(err.message.includes(...)) for substring assertions — it gives a clearer diff on failure. Same applies to the identical pattern at line 247.

— Claude Code

@claude

claude Bot commented Jun 18, 2026

Copy link
Copy Markdown
  • Test names using it() should start with "should" (tests/unit/api/objectCopyPart.js — multiple tests)
    - Prefix each test name with "should" (e.g. 'should return true when...')
    - Prefer assert.match over assert(err.message.includes(...)) for substring assertions (tests/functional/aws-node-sdk/test/object/mpuUploadPartChecksum.js — lines 136, 247)
    - Use assert.match(err.message, /expected checksum Type/) for clearer failure output

    Review by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants