Skip to content

Handle BucketAlreadyExists races and bump arsenal for MPU afterEach fix#6222

Open
benzekrimaha wants to merge 4 commits into
development/9.3from
improvement/CLDSRV-919-afterEach-flakiness-internal-error-fix
Open

Handle BucketAlreadyExists races and bump arsenal for MPU afterEach fix#6222
benzekrimaha wants to merge 4 commits into
development/9.3from
improvement/CLDSRV-919-afterEach-flakiness-internal-error-fix

Conversation

@benzekrimaha

@benzekrimaha benzekrimaha commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Context

ARSN-613 changes MongoDB createBucket() to return
BucketAlreadyExists when another request wins a concurrent metastore upsert.
Cloudserver must handle this explicit result instead of surfacing an
InternalError.

This fixes an intermittent MPU test-cleanup failure where concurrent
ListMultipartUploads calls race while creating the hidden MPU shadow bucket.

Paired Arsenal change:
Arsenal #2672.

Arsenal dependency

Cloudserver is temporarily pinned to Arsenal commit:

506014399741d3fd011c25288fc38c985337babe

Before release, this SHA will be replaced with the Arsenal release tag containing
ARSN-613.

Issue: CLDSRV-919

@bert-e

bert-e commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Hello benzekrimaha,

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 Jul 8, 2026

Copy link
Copy Markdown
Contributor

Incorrect fix version

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

@benzekrimaha
benzekrimaha force-pushed the improvement/CLDSRV-919-afterEach-flakiness-internal-error-fix branch 2 times, most recently from ab63d85 to 2cae9bc Compare July 8, 2026 15:31
@benzekrimaha
benzekrimaha changed the base branch from development/9.4 to development/9.3 July 8, 2026 15:31
@benzekrimaha benzekrimaha changed the title CLDSRV-919: bump arsenal to 8.5.7 for MPU afterEach flake fix Bump arsenal with MPU afterEach flakiness fix Jul 8, 2026
@scality scality deleted a comment from bert-e Jul 8, 2026
@scality scality deleted a comment from bert-e Jul 8, 2026
@bert-e

bert-e commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Request integration branches

Waiting for integration branch creation to be requested by the user.

To request integration branches, please comment on this pull request with the following command:

/create_integration_branches

Alternatively, the /approve and /create_pull_requests commands will automatically
create the integration branches.

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

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

The following options are set: create_integration_branches

@bert-e

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

The following options are set: create_pull_requests, create_integration_branches

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.79888% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.98%. Comparing base (055ae1b) to head (a7978ae).
⚠️ Report is 2 commits behind head on development/9.3.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
lib/services.js 78.33% 26 Missing ⚠️
lib/api/apiUtils/bucket/bucketCreation.js 94.91% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
lib/api/apiUtils/bucket/bucketCreation.js 93.54% <94.91%> (+0.15%) ⬆️
lib/services.js 87.53% <78.33%> (+0.09%) ⬆️

... and 2 files with indirect coverage changes

@@                 Coverage Diff                 @@
##           development/9.3    #6222      +/-   ##
===================================================
+ Coverage            84.93%   84.98%   +0.04%     
===================================================
  Files                  206      206              
  Lines                13366    13372       +6     
===================================================
+ Hits                 11353    11364      +11     
+ Misses                2013     2008       -5     
Flag Coverage Δ
file-ft-tests 68.37% <70.39%> (-0.02%) ⬇️
file-ft-tests-null-compat 68.94% <70.94%> (+0.03%) ⬆️
kmip-ft-tests 28.29% <36.31%> (+<0.01%) ⬆️
mongo-v0-ft-tests 69.59% <72.06%> (-0.04%) ⬇️
mongo-v1-ft-tests 69.57% <71.50%> (-0.05%) ⬇️
multiple-backend 36.76% <32.96%> (-0.01%) ⬇️
s3c-ft-tests-v0 64.10% <74.86%> (-0.02%) ⬇️
s3c-ft-tests-v0-null-compat 64.16% <74.86%> (-0.02%) ⬇️
s3c-ft-tests-v1 64.08% <74.86%> (-0.02%) ⬇️
sur-tests 35.82% <51.39%> (-0.83%) ⬇️
sur-tests-inflights 37.66% <53.07%> (-0.01%) ⬇️
unit 70.53% <78.77%> (+0.02%) ⬆️
utapi-v2-tests 34.54% <56.42%> (-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.

@benzekrimaha
benzekrimaha requested a review from tcarmet July 8, 2026 15:39
@benzekrimaha
benzekrimaha force-pushed the improvement/CLDSRV-919-afterEach-flakiness-internal-error-fix branch from 2cae9bc to 6178ad8 Compare July 9, 2026 15:30
@benzekrimaha benzekrimaha changed the title Bump arsenal with MPU afterEach flakiness fix Handle BucketAlreadyExists races and bump arsenal for MPU afterEach fix Jul 9, 2026
@scality scality deleted a comment from bert-e Jul 9, 2026
@scality scality deleted a comment from bert-e Jul 9, 2026
@scality scality deleted a comment from bert-e Jul 9, 2026
@scality scality deleted a comment from bert-e Jul 9, 2026
@scality scality deleted a comment from bert-e Jul 9, 2026
@scality scality deleted a comment from bert-e Jul 9, 2026
@bert-e

bert-e commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Request integration branches

Waiting for integration branch creation to be requested by the user.

To request integration branches, please comment on this pull request with the following command:

/create_integration_branches

Alternatively, the /approve and /create_pull_requests commands will automatically
create the integration branches.

@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.

I think the pr is fine but some changes are complicated to understand (#6222 (comment)), also the linter with some commits not squashed yet is very hard to read

Comment thread lib/api/apiUtils/bucket/bucketCreation.js
Treat a concurrent creator as the owner of normal bucket cleanup and return the local minimal MPU bucket without another metadata read.

Issue: CLDSRV-919
@benzekrimaha
benzekrimaha force-pushed the improvement/CLDSRV-919-afterEach-flakiness-internal-error-fix branch 2 times, most recently from a5ee5bb to 63926ab Compare July 20, 2026 09:22
Comment thread lib/api/apiUtils/bucket/bucketCreation.js
@benzekrimaha
benzekrimaha requested a review from maeldonn July 21, 2026 15:09
@delthas

delthas commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

@maeldonn , please review in my place as I'm going on PTO! Thanks

@delthas
delthas removed their request for review July 21, 2026 16:52
benzekrimaha added a commit to scality/Arsenal that referenced this pull request Jul 23, 2026
Concurrent MongoDB createBucket calls behaved as silent idempotent writes,
so a request losing the race could overwrite the winner's bucket metadata.

- This commit uses $setOnInsert in the metastore upsert so duplicate requests never
  overwrite existing bucket metadata, and returns BucketAlreadyExists when
  the upsert matches an existing entry, aligning with the other backends.
- Treats BucketAlreadyExists as success when initializing usersBucket.
- Treats NamespaceExists as success after a new metastore insert (an
  orphaned backing collection is not a bucket-level duplicate) and keeps
  sharding it; treats AlreadyInitialized as success.
- Invokes the callback outside Promise rejection handling and returns the
  chain, so a callback exception can no longer trigger a second callback.

Must be deployed with scality/cloudserver#6222, which handles the new
error in the normal and MPU shadow-bucket creation paths.

Issue: ARSN-613
benzekrimaha added a commit to scality/Arsenal that referenced this pull request Jul 23, 2026
…cates

Concurrent MongoDB createBucket calls behaved as silent idempotent writes,
so a request losing the race could overwrite the winner's bucket metadata.

- Use $setOnInsert in the metastore upsert so duplicate requests never
  overwrite existing bucket metadata, and return BucketAlreadyExists when
  the upsert matches an existing entry, aligning with the other backends.
- Treat BucketAlreadyExists as success when initializing usersBucket.
- Treat NamespaceExists as success after a new metastore insert (an
  orphaned backing collection is not a bucket-level duplicate) and keep
  sharding it; treat AlreadyInitialized as success.
- Invoke the callback outside Promise rejection handling and return the
  chain, so a callback exception can no longer trigger a second callback.

Must be deployed with scality/cloudserver#6222, which handles the new
error in the normal and MPU shadow-bucket creation paths.

Issue: ARSN-613

@maeldonn maeldonn 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.

LGTM

@benzekrimaha
benzekrimaha force-pushed the improvement/CLDSRV-919-afterEach-flakiness-internal-error-fix branch from 123ad9b to d25b259 Compare July 23, 2026 11:05
Keep the Prettier migration isolated from the functional race fix so reviewers can inspect the behavior independently.

Issue: CLDSRV-919
@benzekrimaha
benzekrimaha force-pushed the improvement/CLDSRV-919-afterEach-flakiness-internal-error-fix branch from d25b259 to a7978ae Compare July 23, 2026 11:07
@benzekrimaha

Copy link
Copy Markdown
Contributor Author

/create_integration_branches

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

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

The following options are set: create_integration_branches

@benzekrimaha

Copy link
Copy Markdown
Contributor Author

/create_pull_requests

@bert-e

bert-e commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Integration data created

I have created the integration data for the additional destination branches.

The following branches will NOT be impacted:

  • development/7.10
  • development/7.4
  • development/7.70
  • development/8.8
  • development/9.0
  • development/9.1
  • development/9.2

Follow integration pull requests if you would like to be notified of
build statuses by email.

The following options are set: create_pull_requests, create_integration_branches

@bert-e

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

The following options are set: create_pull_requests, create_integration_branches

@bert-e

bert-e commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Conflict

There is a conflict between your branch improvement/CLDSRV-919-afterEach-flakiness-internal-error-fix and the
destination branch development/9.3.

Please resolve the conflict on the feature branch (improvement/CLDSRV-919-afterEach-flakiness-internal-error-fix).

git fetch && \
git checkout origin/improvement/CLDSRV-919-afterEach-flakiness-internal-error-fix && \
git merge origin/development/9.3

Resolve merge conflicts and commit

git push origin HEAD:improvement/CLDSRV-919-afterEach-flakiness-internal-error-fix

The following options are set: create_pull_requests, create_integration_branches

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.

8 participants