Skip to content

fix putData : detect collision on specific provided version id#6230

Open
SylvainSenechal wants to merge 1 commit into
development/9.4from
improvement/CLDSRV-953
Open

fix putData : detect collision on specific provided version id#6230
SylvainSenechal wants to merge 1 commit into
development/9.4from
improvement/CLDSRV-953

Conversation

@SylvainSenechal

Copy link
Copy Markdown
Contributor

Issue: CLDSRV-953

The putData collision detection previously fetched the master object and compared its versionId against the incoming x-scal-version-id header. This caused issues when replicating a non-current version : the master's versionId wouldn't match, so no collision was detected and data was re-uploaded unnecessarily

Fix : decode the x-scal-version-id header in the router and use it as the metadata lookup key, so objMd is always the specific version being replicated

@bert-e

bert-e commented Jul 20, 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.

errorInstances.BadRequest.customizeDescription('bad request: invalid x-scal-version-id header'),
);
}
if (objMd && objMd.versionId === incomingVersionIdDecoded) {

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.

No need for objMd.versionId === incomingVersionIdDecoded anymore as the middleware is already fetching objMd for the specific versionID provided in the header

Comment thread lib/routes/routeBackbeat.js
@bert-e

bert-e commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Waiting for approval

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

  • the author

  • 2 peers

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.06%. Comparing base (0d08680) to head (18d305d).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
lib/routes/routeBackbeat.js 78.95% <100.00%> (+0.20%) ⬆️

... and 2 files with indirect coverage changes

@@                 Coverage Diff                 @@
##           development/9.4    #6230      +/-   ##
===================================================
- Coverage            86.10%   86.06%   -0.04%     
===================================================
  Files                  212      212              
  Lines                14483    14491       +8     
===================================================
+ Hits                 12470    12472       +2     
- Misses                2013     2019       +6     
Flag Coverage Δ
file-ft-tests 70.12% <100.00%> (-0.04%) ⬇️
file-ft-tests-null-compat 70.60% <100.00%> (-0.04%) ⬇️
kmip-ft-tests 27.92% <7.69%> (-0.01%) ⬇️
mongo-v0-ft-tests 71.24% <100.00%> (+0.01%) ⬆️
mongo-v1-ft-tests 71.22% <100.00%> (+0.01%) ⬆️
multiple-backend 36.15% <53.84%> (+0.01%) ⬆️
s3c-ft-tests-v0 65.15% <100.00%> (+0.01%) ⬆️
s3c-ft-tests-v0-null-compat 65.21% <100.00%> (+0.01%) ⬆️
s3c-ft-tests-v1 65.13% <100.00%> (+0.01%) ⬆️
sur-tests 34.78% <7.69%> (-0.90%) ⬇️
sur-tests-inflights 37.54% <7.69%> (-0.04%) ⬇️
unit 73.02% <100.00%> (+0.01%) ⬆️
utapi-v2-tests 35.09% <7.69%> (-0.02%) ⬇️

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.

@scality scality deleted a comment from bert-e Jul 20, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes Backbeat putData collision detection for replication of non-current object versions by ensuring the metadata lookup targets the specific replicated version (from x-scal-version-id) rather than always using the master version.

Changes:

  • Decode x-scal-version-id in the Backbeat router for PUT /_/backbeat/data and use it as the versionId for metadata lookup so objMd corresponds to the replicated version.
  • Simplify collision detection in putData to treat the presence of that specific version’s objMd as a collision (while explicitly excluding ExternalNullVersionId / "null").
  • Add functional test coverage for collisions on a non-current version and adjust the "null" version test to cover cases where a master already exists.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/functional/backbeat/putData.js Adds/updates functional tests to validate collision behavior for non-current versions and "null" version behavior.
lib/routes/routeBackbeat.js Uses decoded x-scal-version-id to fetch version-specific metadata for putData, fixing collision detection semantics.

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