Skip to content

Fix DeleteObject crash on NFS bucket with replication - #6389

Open
delthas wants to merge 2 commits into
development/9.6from
bugfix/CLDSRV-1085/nfs-delete-overhead-field
Open

delthas wants to merge 2 commits into
development/9.6from
bugfix/CLDSRV-1085/nfs-delete-overhead-field

Conversation

@delthas

@delthas delthas commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

On an NFS bucket with replication, DeleteObject called createAndStoreObject without the overheadField argument. The remaining arguments shifted, so log received the originOp string and the first log.trace threw an uncaught TypeError, crashing the worker.

The argument was added by CLDSRV-449 on a branch without this NFS code path, and this call site was missed when merging forward.

  • First commit: move the replication request builder used by bucketPutVersioning tests into tests/unit/helpers.js (no behaviour change).
  • Second commit: pass overheadField, with a unit test deleting an object in an NFS bucket with replication.

Issue: CLDSRV-1085

So that other unit tests can put a replication configuration on a
bucket.

Issue: CLDSRV-1085
The createAndStoreObject call creating the delete marker was missing
the overheadField argument, shifting log, originOp and the callback.
The first log call then threw an uncaught TypeError, crashing the
worker.

The argument was added by CLDSRV-449 on a branch without this NFS
code path, and the call site was missed when merging forward.

Issue: CLDSRV-1085
@bert-e

bert-e commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Hello delthas,

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 ⭐
/bypass_source_branch_lineage Bypass the cross-branch contamination check ⭐
/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.
/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.

next => objectDelete(authInfo, testDeleteRequest, log, next),
next =>
objectGet(authInfo, testGetObjectRequest, false, log, err => {
assert.strictEqual(err.is.NoSuchKey, true);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Compare the error message instead of err.is.NoSuchKey, so a failure shows the actual error. If the object was not deleted, err is null and err.is throws a TypeError instead of a clear assertion failure.

Suggested change
assert.strictEqual(err.is.NoSuchKey, true);
assert.strictEqual(err?.message, 'NoSuchKey');

@delthas
delthas marked this pull request as ready for review November 20, 2026 14:38
@delthas
delthas requested review from a team, SylvainSenechal and benzekrimaha November 20, 2026 14:38
@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.89%. Comparing base (c89adac) to head (d000c62).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
lib/api/objectDelete.js 96.80% <100.00%> (+9.07%) ⬆️

... and 2 files with indirect coverage changes

@@                 Coverage Diff                 @@
##           development/9.6    #6389      +/-   ##
===================================================
+ Coverage            90.86%   90.89%   +0.03%     
===================================================
  Files                  208      208              
  Lines                39275    39276       +1     
===================================================
+ Hits                 35686    35701      +15     
+ Misses                3589     3575      -14     
Flag Coverage Δ
checksums-disabled-tests 46.28% <0.00%> (-0.01%) ⬇️
file-ft-tests 75.77% <0.00%> (-0.01%) ⬇️
file-ft-tests-null-compat 76.25% <0.00%> (-0.03%) ⬇️
kmip-ft-tests 43.92% <0.00%> (-0.01%) ⬇️
mongo-v0-ft-tests 76.81% <0.00%> (-0.08%) ⬇️
mongo-v1-ft-tests 76.82% <0.00%> (-0.01%) ⬇️
multiple-backend 44.50% <0.00%> (-0.01%) ⬇️
s3c-ft-tests-v0 71.63% <0.00%> (-0.01%) ⬇️
s3c-ft-tests-v0-null-compat 71.68% <0.00%> (-0.01%) ⬇️
s3c-ft-tests-v1 71.60% <0.00%> (-0.05%) ⬇️
sur-tests 45.04% <0.00%> (-0.01%) ⬇️
sur-tests-inflights 48.40% <0.00%> (-0.01%) ⬇️
unit 80.91% <100.00%> (+0.08%) ⬆️
utapi-v2-tests 45.20% <0.00%> (-0.01%) ⬇️

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 Nov 20, 2026
@bert-e

bert-e commented Nov 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

@SylvainSenechal SylvainSenechal left a comment •

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.

lmao that's pretty big, but I suppose it's a path that's rarely called otherwise we would've gotten rd tickets.

Could put the fix on a lower cloudserver version

This branch has not been deployed

No deployments
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