Skip to content

Add CRR Cascaded capabilities#6179

Open
SylvainSenechal wants to merge 2 commits into
development/9.4from
improvement/CLDSRV-897
Open

Add CRR Cascaded capabilities#6179
SylvainSenechal wants to merge 2 commits into
development/9.4from
improvement/CLDSRV-897

Conversation

@SylvainSenechal

@SylvainSenechal SylvainSenechal commented May 29, 2026

Copy link
Copy Markdown
Contributor

ISSUE : CLDSRV-897

Crr cascaded design : https://github.com/scality/citadel/pull/349

Related PRs :
Arsenal : scality/Arsenal#2628
CloudserverClient : scality/cloudserverclient#24
Backbeat : scality/backbeat#2747
S3utils : scality/s3utils#395

@bert-e

bert-e commented May 29, 2026

Copy link
Copy Markdown
Contributor

Hello sylvainsenechal,

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.

Comment thread lib/api/apiUtils/object/versioning.js Outdated
Comment thread lib/routes/routeBackbeat.js Outdated
bucketName: request.bucketName,
objectKey: request.objectKey,
});
return callback(errors.OperationAborted);

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.

many 409 available in arsenal. we can pick this one, maybe some other ones, or create our own

Comment thread lib/routes/routeBackbeat.js Outdated
Comment thread package.json Outdated
"@hapi/joi": "^17.1.1",
"@smithy/node-http-handler": "^3.0.0",
"arsenal": "git+https://github.com/scality/Arsenal#8.4.2",
"arsenal": "file:../Arsenal",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

arsenal and @scality/cloudserverclient are pointing to local filesystem paths (file:../Arsenal, file:../cloudserverclient) instead of pinned git tags. This will break installs for anyone who does not have these directories locally, and CI will fail to resolve them.

Suggested change
"arsenal": "file:../Arsenal",
"arsenal": "git+https://github.com/scality/Arsenal#8.4.2",

— Claude Code

Comment thread package.json Outdated
"devDependencies": {
"@eslint/compat": "^1.2.2",
"@scality/cloudserverclient": "1.0.7",
"@scality/cloudserverclient": "file:../cloudserverclient",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same issue: file:../cloudserverclient should be pinned to a published version or git tag.

— Claude Code

Comment thread tests/functional/backbeat/crrCascade.js Outdated
});

describe('CRR cascade — putMetadata', () => {
it('second write with the same microVersionId returns loop-detected', async () => {

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 per project conventions.

— Claude Code

}],
},
}));
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing after() hook to clean up the test buckets (TEST_BUCKET, TEST_BUCKET_CRR, DEST_BUCKET). Without cleanup, leftover buckets accumulate across test runs and can cause name collisions or resource leaks.

— Claude Code

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.

bucket/keys names are randomized
I intentionnally didnt add any after to keep the test and file lighter.

Do we want to add after cleanup ?

@claude

claude Bot commented May 29, 2026

Copy link
Copy Markdown
  • Dependency pinning: arsenal and @scality/cloudserverclient in package.json use file: paths pointing to local directories. These must be pinned to git tags or published versions before merge.
    • arsenal on line 36: file:../Arsenal → should be a git tag (e.g. 8.4.2)
    • @scality/cloudserverclient on line 68: file:../cloudserverclient → should be a versioned reference
  • Test naming: it() descriptions in tests/functional/backbeat/crrCascade.js should start with should per project conventions.
  • Test cleanup: No after() hook to delete the three buckets created in before(). Leftover buckets will accumulate across test runs.

Review by Claude Code

Comment thread lib/routes/routeBackbeat.js
Comment thread lib/routes/routeBackbeat.js Outdated

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.

all these worked locally, need to wait for the bumps now

Comment thread package.json Outdated
"@hapi/joi": "^17.1.1",
"@smithy/node-http-handler": "^3.0.0",
"arsenal": "git+https://github.com/scality/Arsenal#8.4.2",
"arsenal": "file:../Arsenal",

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.

TODO 🧐

@SylvainSenechal SylvainSenechal changed the title Improvement/cldsrv 897 Add CRR Cascaded capabilities May 29, 2026
@SylvainSenechal SylvainSenechal requested review from a team, delthas and maeldonn May 29, 2026 18:11
@SylvainSenechal SylvainSenechal force-pushed the improvement/CLDSRV-897 branch from c15fb2b to 7912480 Compare May 29, 2026 18:38
@codecov

codecov Bot commented May 29, 2026

Copy link
Copy Markdown

⚠️ JUnit XML file not found

The CLI was unable to find any JUnit XML files to upload.
For more help, visit our troubleshooting guide.

Comment thread tests/functional/backbeat/crrCascade.js Outdated
});

describe('CRR cascade — putMetadata', () => {
it('second write with the same microVersionId returns loop-detected', async () => {

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 should start with "should" per project conventions (e.g. should return loop-detected on second write with the same microVersionId).

— Claude Code

Comment thread package.json Outdated
"@hapi/joi": "^17.1.1",
"@smithy/node-http-handler": "^3.0.0",
"arsenal": "git+https://github.com/scality/Arsenal#8.4.2",
"arsenal": "file:../Arsenal",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

arsenal and @scality/cloudserverclient use file: local path references. These must be pinned to a tag or version before merging — file: references will break any install outside of your local workstation.

— Claude Code

@claude

claude Bot commented May 29, 2026

Copy link
Copy Markdown
  • package.json: arsenal and @scality/cloudserverclient use file: local path references instead of pinned tags/versions — these will break installs for anyone else and must be updated before merge
    - Pin arsenal to the Arsenal PR tag once merged (was 8.4.2)
    - Pin @scality/cloudserverclient to a published version (was 1.0.7)
    - tests/functional/backbeat/crrCascade.js: test names in it() blocks should start with should

    Review by Claude Code

Comment thread lib/routes/routeBackbeat.js Outdated
}

const encodedMicroVersionId = request.headers['x-scal-micro-version-id'];
const incomingRaw = encodedMicroVersionId ? decodeMicroVersionId(encodedMicroVersionId) : null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The decode error handling here differs from putMetadata (line 574-575), which normalises the result immediately so incomingRaw is guaranteed non-Error. Here incomingRaw can hold an Error object, then is checked later with !(incomingRaw instanceof Error). Consider aligning with the putMetadata pattern for consistency.

— Claude Code

Comment thread tests/functional/backbeat/crrCascade.js
Comment thread package.json Outdated
"@hapi/joi": "^17.1.1",
"@smithy/node-http-handler": "^3.0.0",
"arsenal": "git+https://github.com/scality/Arsenal#8.4.2",
"arsenal": "file:../Arsenal",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

arsenal and @scality/cloudserverclient point to local file:../ paths. These must be pinned to git tags before merging — anyone cloning this repo won't have these sibling directories.

— Claude Code

Comment thread lib/utilities/collectResponseHeaders.js
@claude

claude Bot commented Jun 1, 2026

Copy link
Copy Markdown
  • package.json: arsenal and @scality/cloudserverclient point to local file:../ paths — must be pinned to git tags before merging.
    - lib/utilities/collectResponseHeaders.js:103: Cascade replicas without a next hop have status: '' and isReplica: true, but the outer if only checks status (falsy for empty string), so x-amz-replication-status: REPLICA header will be missing from S3 responses for these objects.
    - lib/routes/routeBackbeat.js:438: putData and putMetadata handle decodeMicroVersionId error cases differently — consider aligning for consistency.
    - tests/functional/backbeat/crrCascade.js: Missing after() hook to clean up the three test buckets created in before().

    Review by Claude Code

Comment thread lib/routes/routeBackbeat.js
Comment thread lib/routes/routeBackbeat.js
Comment thread package.json Outdated
"@opentelemetry/instrumentation-mongodb": "~0.69.0",
"@smithy/node-http-handler": "^3.0.0",
"arsenal": "git+https://github.com/scality/Arsenal#8.4.7",
"arsenal": "git+https://github.com/scality/Arsenal#83682d1ae77705877b81414f39aacce4e27e0ceb",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Arsenal is pinned to a commit hash instead of a tag. Per project conventions, git-based deps (arsenal, vaultclient, bucketclient, werelogs, utapi, scubaclient) should pin to a tag, not a branch or commit.

— Claude Code

Comment thread package.json
"vaultclient": "scality/vaultclient#8.5.3",
"werelogs": "scality/werelogs#8.2.2",
"ws": "^8.18.0",
"@scality/cloudserverclient": "./scality-cloudserverclient-v1.0.9.tgz",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@scality/cloudserverclient was moved from devDependencies to dependencies and changed from a registry version to a local .tgz file. Committing binary tarballs to the repo is fragile — it bloats the repo, makes updates opaque, and breaks reproducibility. Additionally, cloudserverclient.tgz is also committed but unused (duplicate of this file). Consider publishing the package to a registry or at least removing the duplicate cloudserverclient.tgz.

— Claude Code

@claude

claude Bot commented Jun 17, 2026

Copy link
Copy Markdown
  • routeBackbeat.js: Missing imports will cause runtime crashes. encode, decode, compareMicroVersionId, Ordering, VersionIdCollisionException, StaleMicroVersionIdException, CascadeLoopDetectedException, writeContinue, and getReplicationInfo are all used but never required/imported. Every code path through the new putData version-collision check and putMetadata cascade logic will throw ReferenceError.
    - Add the missing require statements at the top of the file.

    - routeBackbeat.js:839-851: Duplicate getCanonicalIdsByAccountId call. The refactored async.series block nests two identical Vault lookups. The original code had one call — the re-indentation accidentally duplicated it, causing Vault to be queried twice for every putMetadata with an accountId.
    - Remove the inner duplicate call; use the outer callback's res directly.

    - package.json: Arsenal pinned to commit hash, not a tag. Git-based deps should pin to tags per project convention.
    - Pin to a tag once the Arsenal changes are released.

    - package.json + Dockerfile: Two identical .tgz files committed. cloudserverclient.tgz and scality-cloudserverclient-v1.0.9.tgz are byte-identical. Only the latter is referenced.
    - Remove the unused cloudserverclient.tgz.

    - package.json: @scality/cloudserverclient moved from devDeps to deps as a local tarball. Committing binaries to the repo is fragile and bloats the history.
    - Consider publishing to a registry instead.

    Review by Claude Code

@SylvainSenechal SylvainSenechal force-pushed the improvement/CLDSRV-897 branch from 32f6a98 to a444e53 Compare June 17, 2026 13:59
Comment thread package.json
"@opentelemetry/instrumentation-mongodb": "~0.69.0",
"@smithy/node-http-handler": "^3.0.0",
"arsenal": "git+https://github.com/scality/Arsenal#8.4.7",
"arsenal": "git+https://github.com/scality/Arsenal#f6b6e2a37675e76186326e22c17b7a4cef77f5e0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Arsenal dependency pinned to a commit hash instead of a tag. Git-based deps should pin to a tag per project conventions.

— Claude Code

Comment thread package.json
"werelogs": "scality/werelogs#8.2.2",
"ws": "^8.18.0",
"@scality/cloudserverclient": "./scality-cloudserverclient-v1.0.9.tgz",
"xml2js": "^0.6.2"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@scality/cloudserverclient is installed from a local tarball checked into the repo. Binary files bloat git history permanently. Consider publishing to a registry or referencing via a git URL with a tag, consistent with how other Scality deps (arsenal, bucketclient, etc.) are managed.

— Claude Code

@claude

claude Bot commented Jun 17, 2026

Copy link
Copy Markdown
  • Unreferenced binary file cloudserverclient.tgz added to the repo. Only scality-cloudserverclient-v1.0.9.tgz is referenced in package.json and Dockerfile. Remove it to avoid unnecessary repo bloat.
  • Arsenal dependency pinned to a commit hash (f6b6e2a...) instead of a tag in package.json.
    • Pin to a tag per project conventions for git-based deps.
  • @scality/cloudserverclient installed from a local tarball (./scality-cloudserverclient-v1.0.9.tgz) checked into the repo, with a second duplicate binary (cloudserverclient.tgz) also committed.
    • Publish to a registry or use a git URL with a tag, consistent with other Scality deps (arsenal, bucketclient, vaultclient, etc.).

Review by Claude Code

@SylvainSenechal SylvainSenechal force-pushed the improvement/CLDSRV-897 branch from a444e53 to eb0241a Compare June 17, 2026 14:13
Comment thread package.json
"@opentelemetry/instrumentation-mongodb": "~0.69.0",
"@smithy/node-http-handler": "^3.0.0",
"arsenal": "git+https://github.com/scality/Arsenal#8.4.7",
"arsenal": "git+https://github.com/scality/Arsenal#f6b6e2a37675e76186326e22c17b7a4cef77f5e0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Arsenal is pinned to a raw commit hash instead of a tag. Per project conventions, git-based deps must pin to a tag, not a branch or commit.

— Claude Code

Comment thread package.json
"vaultclient": "scality/vaultclient#8.5.3",
"werelogs": "scality/werelogs#8.2.2",
"ws": "^8.18.0",
"@scality/cloudserverclient": "./scality-cloudserverclient-v1.0.9.tgz",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@scality/cloudserverclient moved from devDependencies (registry) to dependencies (local tgz). Shipping a checked-in tarball is fragile — the tgz won't get security patches unless someone manually rebuilds and re-commits it. Also, this is now a production dependency but previously was dev-only, which is a significant change.

— Claude Code

Comment thread tests/functional/backbeat/crrCascade.js Outdated
}],
},
}));
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing after cleanup hook. Three test buckets are created in before() but never deleted. Add an after() to clean them up so parallel test runs don't leak buckets.

— Claude Code

@claude

claude Bot commented Jun 17, 2026

Copy link
Copy Markdown
  • Dependency pinning: arsenal is pinned to a raw commit hash (f6b6e2a...) instead of a tag. Git-based deps should pin to tags per project conventions.
    - Tag the Arsenal commit and reference the tag instead.
    - Duplicate binary file: cloudserverclient.tgz is byte-identical to scality-cloudserverclient-v1.0.9.tgz but is not referenced anywhere. It adds 721 KB of dead weight to the repo.
    - Remove cloudserverclient.tgz.
    - cloudserverclient moved to production dependency as a local tgz: Previously @scality/cloudserverclient was a dev-only registry dependency. It is now a production dependency pointing at a checked-in tarball. This is fragile for security patches and a significant scope change.
    - Consider publishing to the registry or using a git-based reference like other Scality deps.
    - Test naming convention: Functional test names in crrCascade.js are missing the should prefix required by project conventions (e.g. throw CascadeLoopDetectedException...should throw CascadeLoopDetectedException...).
    - Prefix all it() descriptions with should.
    - Missing test cleanup: The functional test before() creates three buckets but there is no after() hook to delete them.
    - Add an after() block to clean up test buckets.

    Review by Claude Code

@SylvainSenechal SylvainSenechal requested a review from maeldonn June 17, 2026 14:22
@SylvainSenechal SylvainSenechal force-pushed the improvement/CLDSRV-897 branch from eb0241a to 92f01c0 Compare June 18, 2026 14:46
Comment thread package.json
"@opentelemetry/instrumentation-mongodb": "~0.69.0",
"@smithy/node-http-handler": "^3.0.0",
"arsenal": "git+https://github.com/scality/Arsenal#8.4.7",
"arsenal": "git+https://github.com/scality/Arsenal#f6b6e2a37675e76186326e22c17b7a4cef77f5e0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Arsenal is pinned to a raw commit hash instead of a semver tag. Project convention requires git-based deps to pin to a tag (e.g. 8.4.7).

— Claude Code

Comment thread package.json
"vaultclient": "scality/vaultclient#8.5.3",
"werelogs": "scality/werelogs#8.2.2",
"ws": "^8.18.0",
"@scality/cloudserverclient": "./scality-cloudserverclient-v1.0.9.tgz",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Both cloudserverclient.tgz and scality-cloudserverclient-v1.0.9.tgz are committed as binary artifacts. Only the latter is referenced in package.json and Dockerfilecloudserverclient.tgz is an orphan. Binary tarballs inflate the git history permanently; consider publishing to the package registry or removing the unused file.

— Claude Code

const olderMvId = makeMicroVersionId();
const newerMvId = makeMicroVersionId();
await putMetadata(key, newerMvId);
try {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This test uses try/catch + assert.fail while the test at line 139 in the same describe block uses assert.rejects. Prefer assert.rejects for consistency.

— Claude Code

const newerMvId = makeMicroVersionId();

await putMetadata(key, olderMvId);
const output = await putMetadata(key, newerMvId);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

output is assigned but never used — the test reads from GetMetadataCommand instead.

```suggestion
await putMetadata(key, newerMvId);

<br><br>— Claude Code

@claude

claude Bot commented Jun 18, 2026

Copy link
Copy Markdown
  • Arsenal is pinned to a raw commit hash (f6b6e2a…) instead of a semver tag — violates the project's dependency pinning convention for git-based deps.
    • Pin to a tag once the Arsenal release containing the required changes is cut.
  • cloudserverclient.tgz is committed but never referenced — only scality-cloudserverclient-v1.0.9.tgz is used in package.json and Dockerfile.
    • Remove the orphan file.
  • Both .tgz binary artifacts are checked into git, inflating history permanently.
    • Consider publishing @scality/cloudserverclient to the registry or using a git ref like other Scality deps.
  • Unused output variable in tests/functional/backbeat/crrCascade.js:228.
    • Drop the assignment: await putMetadata(key, newerMvId);
  • Inconsistent error-assertion pattern in the same describe block: line 139 uses assert.rejects, line 158 uses try/catch + assert.fail.
    • Use assert.rejects in both tests for consistency.

Review by Claude Code

@SylvainSenechal SylvainSenechal force-pushed the improvement/CLDSRV-897 branch from 92f01c0 to 365213b Compare June 18, 2026 15:19
Comment thread package.json
"@opentelemetry/instrumentation-mongodb": "~0.69.0",
"@smithy/node-http-handler": "^3.0.0",
"arsenal": "git+https://github.com/scality/Arsenal#8.4.7",
"arsenal": "git+https://github.com/scality/Arsenal#f6b6e2a37675e76186326e22c17b7a4cef77f5e0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Arsenal is pinned to a commit hash instead of a tag. Per project conventions, git-based deps must pin to a tag, not a branch or commit.

— Claude Code

omVal.isDeleteMarker &&
omVal.replicationInfo &&
omVal.replicationInfo.status === 'REPLICA' &&
(omVal.replicationInfo.isReplica || omVal.replicationInfo.status === 'REPLICA') &&

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Inconsistent isReplica check: this line uses a truthy check (isReplica), but lines 654, 671, and 750 use strict equality (isReplica === true). Use strict equality here for consistency.

— Claude Code

const newerMvId = makeMicroVersionId();

await putMetadata(key, olderMvId);
const output = await putMetadata(key, newerMvId);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

output is assigned but never used. Remove the assignment.

— Claude Code

@claude

claude Bot commented Jun 18, 2026

Copy link
Copy Markdown
  • package.json:40 — Arsenal is pinned to a commit hash instead of a tag. Git-based deps should pin to a tag per project conventions.
    - cloudserverclient.tgz — This file is added but never referenced anywhere (package.json and Dockerfile only reference scality-cloudserverclient-v1.0.9.tgz). Remove the orphan file.
    - lib/routes/routeBackbeat.js:638 — Inconsistent isReplica check uses truthy (isReplica) while lines 654, 671, and 750 use strict equality (isReplica === true). Use strict equality for consistency.
    - tests/functional/backbeat/crrCascade.js:228output variable assigned but never used.

    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