Skip to content

Bump microVersionId and add isReplica handling#6178

Open
maeldonn wants to merge 5 commits into
development/9.4from
improvement/CLDSRV-906/micro-version-id
Open

Bump microVersionId and add isReplica handling#6178
maeldonn wants to merge 5 commits into
development/9.4from
improvement/CLDSRV-906/micro-version-id

Conversation

@maeldonn
Copy link
Copy Markdown
Contributor

Cloudserver-side prep for cascaded CRR (design): bumps arsenal to the improvement/ARSN-578/micro-version-id branch, bumps microVersionId on every user-facing object metadata write through a single bumpMicroVersionId helper (gated on replicationInfo presence to keep storage tight, with a force flag preserving the existing overwriting-version path), sources x-amz-replication-status from the new ReplicationInfo.isReplica field with a legacy status === 'REPLICA' fallback, and clears isReplica on direct user writes (tagging / ACL / retention / legal hold) so a modified replica stops looking like one. The backbeat-route side of the design (setting isReplica = true on incoming replicas, cascade comparison, MultiBackend guard) lands in a follow-up ticket — until then the new fields are read but never set, so observable behavior is unchanged.

Issue: CLDSRV-906

@maeldonn maeldonn requested review from a team, benzekrimaha and delthas May 29, 2026 08:13
@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 29, 2026

Hello maeldonn,

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
Copy link
Copy Markdown
Contributor

bert-e commented May 29, 2026

Incorrect fix version

The Fix Version/s in issue CLDSRV-906 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-906, or the target
branch of this pull request.

Comment thread package.json Outdated
Comment thread tests/unit/api/apiUtils/object/bumpMicroVersionId.js Outdated
Comment thread tests/unit/api/objectReplicationMD.js Outdated
@claude
Copy link
Copy Markdown

claude Bot commented May 29, 2026

  • arsenal is pinned to a branch instead of a tag in package.json — git-based deps must pin to a tag for reproducible builds.
    - Test names in tests/unit/api/apiUtils/object/bumpMicroVersionId.js and tests/unit/api/objectReplicationMD.js should start with "should".

    Review by Claude Code

@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

❌ Patch coverage is 91.73554% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.33%. Comparing base (9fc5974) to head (55a124a).
⚠️ Report is 5 commits behind head on development/9.4.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
lib/services.js 77.68% 27 Missing ⚠️
lib/api/apiUtils/object/versioning.js 90.32% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
lib/api/apiUtils/object/bumpMicroVersionId.js 100.00% <100.00%> (ø)
lib/api/apiUtils/object/getReplicationInfo.js 100.00% <100.00%> (ø)
lib/api/objectDeleteTagging.js 100.00% <100.00%> (ø)
lib/api/objectPutLegalHold.js 96.36% <100.00%> (+1.91%) ⬆️
lib/api/objectPutRetention.js 97.05% <100.00%> (+1.60%) ⬆️
lib/api/objectPutTagging.js 100.00% <100.00%> (ø)
lib/metadata/acl.js 98.68% <100.00%> (ø)
lib/utilities/collectResponseHeaders.js 100.00% <100.00%> (ø)
lib/api/apiUtils/object/versioning.js 97.12% <90.32%> (ø)
lib/services.js 87.43% <77.68%> (ø)

... and 1 file with indirect coverage changes

@@                 Coverage Diff                 @@
##           development/9.4    #6178      +/-   ##
===================================================
+ Coverage            85.30%   85.33%   +0.02%     
===================================================
  Files                  208      209       +1     
  Lines                13919    13934      +15     
===================================================
+ Hits                 11874    11890      +16     
+ Misses                2045     2044       -1     
Flag Coverage Δ
file-ft-tests 68.78% <83.47%> (-0.09%) ⬇️
kmip-ft-tests 28.15% <15.97%> (+0.02%) ⬆️
mongo-v0-ft-tests 69.95% <84.84%> (-0.15%) ⬇️
mongo-v1-ft-tests 69.99% <84.84%> (+0.01%) ⬆️
multiple-backend 36.64% <31.40%> (+0.03%) ⬆️
sur-tests 35.48% <29.47%> (+0.02%) ⬆️
sur-tests-inflights 37.36% <30.30%> (+0.02%) ⬆️
unit 72.06% <78.51%> (+0.04%) ⬆️
utapi-v2-tests 34.76% <29.75%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread lib/api/objectDeleteTagging.js Outdated
Comment thread lib/api/objectPutLegalHold.js Outdated
const { instanceId, replicationGroupId } = config;

// eslint-disable-next-line no-param-reassign
objectMD.microVersionId = versioning.VersionID.generateVersionId(instanceId, replicationGroupId);
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.

isn't there a method ObjectMD.updateMicroVersionId() in arsenal ? should it not be used instead?

(if we can't because of POJO, then I wonder if that function was really useful....)

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.

ObjectMD.updateMicroVersionId() is used by s3utils that holds ObjectMD instances. Cloudserver's call sites here all hold POJOs from metadata.getObjectMD, so we use the lower-level versioning.VersionID.generateVersionId (which is exactly what updateMicroVersionId calls internally). Both arsenal entry points are valid for their respective consumer shapes.

Comment thread lib/services.js Outdated
@maeldonn maeldonn force-pushed the improvement/CLDSRV-906/micro-version-id branch from 3b4110b to 6ba0ebe Compare June 3, 2026 14:09
Comment thread package.json Outdated
Comment thread tests/unit/api/apiUtils/object/bumpMicroVersionId.js Outdated
Comment thread tests/unit/api/objectReplicationMD.js Outdated
@claude
Copy link
Copy Markdown

claude Bot commented Jun 3, 2026

  • Arsenal dependency is pinned to a branch, not a tag — pin to a tagged release before merging to production
    - Test names in bumpMicroVersionId.js and objectReplicationMD.js should start with should per project convention

    Review by Claude Code

@maeldonn maeldonn force-pushed the improvement/CLDSRV-906/micro-version-id branch from 6ba0ebe to ce0ff8e Compare June 3, 2026 14:14
@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented Jun 3, 2026

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

Comment thread package.json
Comment thread tests/unit/api/apiUtils/object/bumpMicroVersionId.js Outdated
Comment thread tests/unit/api/objectReplicationMD.js Outdated
@claude
Copy link
Copy Markdown

claude Bot commented Jun 3, 2026

  • Arsenal dependency pinned to a commit SHA instead of a release tag (package.json)
    - Pin to a tagged release before merging; the previous value was 8.4.4
    - Test names in it() blocks don't start with "should" (bumpMicroVersionId.js, objectReplicationMD.js)
    - Prefix test descriptions with "should" per project conventions

    Review by Claude Code

@maeldonn maeldonn force-pushed the improvement/CLDSRV-906/micro-version-id branch from ce0ff8e to 28a3bfb Compare June 3, 2026 15:12
Comment thread lib/api/objectDeleteTagging.js Dismissed
Comment thread lib/api/objectDeleteTagging.js Dismissed
Comment thread lib/api/objectDeleteTagging.js Dismissed
Comment thread lib/api/objectPutLegalHold.js Dismissed
Comment thread lib/api/objectPutLegalHold.js Dismissed
Comment thread lib/api/objectPutTagging.js Dismissed
Comment thread lib/api/objectPutTagging.js Dismissed
Comment thread lib/services.js Dismissed
Comment thread lib/services.js Dismissed
Comment thread lib/services.js Dismissed
Comment thread package.json
@claude
Copy link
Copy Markdown

claude Bot commented Jun 3, 2026

  • Arsenal dependency pinned to a commit hash instead of a release tag (package.json:36). Update to a tag once the arsenal improvement/ARSN-578/micro-version-id branch changes are released.

    The logic changes (bumpMicroVersionId helper, isReplica clearing on user writes, isReplica-aware replication-status header) are correct and well-tested.

    Review by Claude Code

@maeldonn maeldonn force-pushed the improvement/CLDSRV-906/micro-version-id branch from 28a3bfb to 6080b1d Compare June 4, 2026 12:17
@maeldonn maeldonn requested a review from francoisferrand June 4, 2026 12:17
Comment thread lib/api/apiUtils/object/versioning.js Dismissed
Comment thread lib/api/apiUtils/object/versioning.js Dismissed
Comment thread lib/api/apiUtils/object/versioning.js Dismissed
Comment thread lib/api/apiUtils/object/versioning.js Outdated
Comment thread package.json
@claude
Copy link
Copy Markdown

claude Bot commented Jun 4, 2026

  • Dead write in overwritingVersioning (restore path): metadataStoreParams.microVersionId is set in overwritingVersioning() but metadataStoreObject() no longer destructures or uses it — the old updateMicroVersionId / md.updateMicroVersionId() was removed without a replacement. Restored objects will not have microVersionId set in their metadata.
    - Consume the new field in metadataStoreObject, or switch the restore caller to bumpMicroVersionId() like the other write paths.
    - Arsenal pinned to a commit SHA: package.json pins arsenal to a raw commit (2c429ab) from a feature branch instead of a release tag.
    - Update to a tag before merging.

    Review by Claude Code

@maeldonn maeldonn force-pushed the improvement/CLDSRV-906/micro-version-id branch from 6080b1d to 9ba1db7 Compare June 4, 2026 13:43
Comment thread package.json
@claude
Copy link
Copy Markdown

claude Bot commented Jun 4, 2026

  • Arsenal dependency is pinned to a commit hash instead of a tag
    - Pin to a tagged release (e.g. #8.x.x) before merging, per project conventions for git-based dependencies

    The logic changes (bumpMicroVersionId helper, isReplica handling in collectResponseHeaders, isReplica clearing on user writes) look correct. The new tests cover the key behaviors well.

    Review by Claude Code

@maeldonn maeldonn force-pushed the improvement/CLDSRV-906/micro-version-id branch from 9ba1db7 to 1070ce3 Compare June 4, 2026 13:58
Comment thread package.json
"@hapi/joi": "^17.1.1",
"@smithy/node-http-handler": "^3.0.0",
"arsenal": "git+https://github.com/scality/Arsenal#8.4.4",
"arsenal": "git+https://github.com/scality/Arsenal#2c429ab35a5ac82c3dafa5a0296a49a23a9c8a4a",
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 (2c429ab35a5ac82c3dafa5a0296a49a23a9c8a4a) instead of a version tag. Per project conventions, git-based deps (arsenal, vaultclient, bucketclient, werelogs, utapi, scubaclient) must pin to a tag, not a branch or commit. This appears to reference the improvement/ARSN-578/micro-version-id feature branch.

Pin to a tagged release once the Arsenal changes are published.

— Claude Code

@claude
Copy link
Copy Markdown

claude Bot commented Jun 4, 2026

  • Arsenal dependency pinned to a commit hash instead of a version tag, violating the project convention for git-based deps. - Pin to a tagged release before merging.

    The functional changes (bumpMicroVersionId helper, isReplica handling in collectResponseHeaders with legacy fallback, isReplica clearing on user writes, microVersionId bumping in tagging/ACL/legal-hold/retention operations) look correct and are well-covered by tests.

    Review by Claude Code

maeldonn added 5 commits June 4, 2026 16:08
Prefer ReplicationInfo.isReplica over replicationInfo.status when
producing x-amz-replication-status. The legacy status === 'REPLICA'
branch is kept as a fallback so objects written before the feature
still surface the correct value.

Issue: CLDSRV-906
Bump microVersionId on every user write that changes object metadata
other than replicationInfo, providing a unique revision identifier
needed by upcoming cascaded CRR loop detection.

Issue: CLDSRV-906
When a user updates tags, ACL, retention, or legal-hold on an object
that arrived via replication (isReplica=true), the resulting object is
no longer a replica - clear the flag so the x-amz-replication-status
response header reflects the new state.

Issue: CLDSRV-906
@maeldonn maeldonn force-pushed the improvement/CLDSRV-906/micro-version-id branch from 1070ce3 to 55a124a Compare June 4, 2026 14:08
Comment thread package.json
"@hapi/joi": "^17.1.1",
"@smithy/node-http-handler": "^3.0.0",
"arsenal": "git+https://github.com/scality/Arsenal#8.4.4",
"arsenal": "git+https://github.com/scality/Arsenal#2c429ab35a5ac82c3dafa5a0296a49a23a9c8a4a",
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 (2c429ab) instead of a release tag. The PR description mentions this is the improvement/ARSN-578/micro-version-id branch. Git-based deps should pin to a tag, not a branch or bare commit, so that the dependency is a reviewed release.

— Claude Code

@claude
Copy link
Copy Markdown

claude Bot commented Jun 4, 2026

  • Arsenal is pinned to a commit hash instead of a release tag (package.json:36). Git-based deps should reference a tag so the dependency is a reviewed, versioned release.
    - Pin to a proper arsenal tag once the upstream branch is released.

    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.

4 participants