Skip to content

fix request size limit for multi delete#5868

Merged
bert-e merged 1 commit intodevelopment/9.1from
bug/CLDSRV-699
Jul 22, 2025
Merged

fix request size limit for multi delete#5868
bert-e merged 1 commit intodevelopment/9.1from
bug/CLDSRV-699

Conversation

@SylvainSenechal
Copy link
Copy Markdown
Contributor

@SylvainSenechal SylvainSenechal commented Jul 17, 2025

Issue: CLDSRV-699

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented Jul 17, 2025

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.

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented Jul 17, 2025

Incorrect fix version

The Fix Version/s in issue CLDSRV-699 contains:

  • None

Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:

  • 9.1.0

Please check the Fix Version/s of CLDSRV-699, or the target
branch of this pull request.

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.91%. Comparing base (615f831) to head (c0b1d0c).
⚠️ Report is 437 commits behind head on development/9.1.

Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
lib/api/api.js 86.31% <100.00%> (+0.14%) ⬆️
lib/api/multiObjectDelete.js 73.23% <100.00%> (+0.09%) ⬆️
@@               Coverage Diff                @@
##           development/9.1    #5868   +/-   ##
================================================
  Coverage            75.91%   75.91%           
================================================
  Files                  188      188           
  Lines                11976    11979    +3     
================================================
+ Hits                  9091     9094    +3     
  Misses                2885     2885           
Flag Coverage Δ
ceph-backend-test 45.46% <100.00%> (+0.01%) ⬆️
file-ft-tests 47.34% <100.00%> (+0.01%) ⬆️
kmip-ft-tests 27.01% <80.00%> (+0.01%) ⬆️
mongo-v0-ft-tests 47.78% <100.00%> (+0.01%) ⬆️
mongo-v1-ft-tests 47.80% <100.00%> (+0.01%) ⬆️
multiple-backend 34.00% <80.00%> (+0.01%) ⬆️
sur-tests 34.62% <100.00%> (-0.02%) ⬇️
sur-tests-inflights 36.57% <100.00%> (+0.01%) ⬆️
unit 66.94% <100.00%> (+<0.01%) ⬆️
utapi-v2-tests 33.35% <100.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.

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented Jul 17, 2025

Waiting for approval

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

  • the author

  • 2 peers

Comment thread lib/api/api.js Outdated
Comment on lines +227 to +228
const defaultMaxPostLength = request.method === 'POST' ?
1024 * 1024 : 512 * 1024; // 1 MB or 512 KB
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

as an optim I think these values should be computed outside of the function, as it would be evaluated in every request otherwise, let's compute it on top of the file?

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.

it depends on request.method, so can't really be computed earlier... And apisLengthLimits is really a constant, so not sure it will change much...

Copy link
Copy Markdown

@ghost ghost Jul 17, 2025

Choose a reason for hiding this comment

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

I mean the 1024*1024 and 512*1024, this can be the real value directly.

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.

I can set it in the constants.js file

Comment thread lib/api/multiObjectDelete.js Outdated
if (err || objects.length < 1 || objects.length > 1000) {
return next(errors.MalformedXML);
if (err || objects.length < 1 || objects.length > constants.maximumBatchDeleteObjects) {
return next(errors.MalformedXML.customizeDescription(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

To use customizeDescription we must not use errors but errorInstances. I think the error should stay the same, unless we are able to confirm what AWS exactly sends, we should be 100% consistent, so we can just keep the base error IMHO

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.

I thought it would be nice to have a more descriptive errors but yeah if we want to stick the same aws errors I'll remove it

Comment thread lib/api/api.js Outdated
const MAX_POST_LENGTH = request.method === 'POST' ?
1024 * 1024 : 1024 * 1024 / 2; // 1 MB or 512 KB
const apisLengthLimits = {
// Multi Objects Delete request can be large : up to 1000 keys of 1024 bytes is
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Were you able to confirm we reach the limit with the 1000 keys?

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.

probably depends on the key length : which can be up to 1024 bytes per key, according to AWS...

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.

Yeah I called the api with smaller requests, and change manually the max_post_length to a significantly lower value to trigger my errors. I logged the body length too and yeah with 1000 long keys it's gonna go above 1MB

Comment thread lib/api/multiObjectDelete.js Outdated
return next(errors.MalformedXML);
if (err || objects.length < 1 || objects.length > constants.maximumBatchDeleteObjects) {
return next(errors.MalformedXML.customizeDescription(
`The provided request tries to delete ${objects.length} objects, ` +
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.

is this the message that AWS returns? (the AWS standard part looks weird)

as a general rule of thumb, we want to stick to same behavior (esp errors) as AWS

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 it's my own error, I realized we want to have the exact same errors as aws so I'll remove it

Comment thread constants.js Outdated
Comment thread lib/api/multiObjectDelete.js Outdated
@SylvainSenechal
Copy link
Copy Markdown
Contributor Author

/approve

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented Jul 22, 2025

In the queue

The changeset has received all authorizations and has been added to the
relevant queue(s). The queue(s) will be merged in the target development
branch(es) as soon as builds have passed.

The changeset will be merged in:

  • ✔️ development/9.1

The following branches will NOT be impacted:

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

There is no action required on your side. You will be notified here once
the changeset has been merged. In the unlikely event that the changeset
fails permanently on the queue, a member of the admin team will
contact you to help resolve the matter.

IMPORTANT

Please do not attempt to modify this pull request.

  • Any commit you add on the source branch will trigger a new cycle after the
    current queue is merged.
  • Any commit you add on one of the integration branches will be lost.

If you need this pull request to be removed from the queue, please contact a
member of the admin team now.

The following options are set: approve

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented Jul 22, 2025

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/9.1

The following branches have NOT changed:

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

Please check the status of the associated issue CLDSRV-699.

Goodbye sylvainsenechal.

@bert-e bert-e merged commit cd4b15e into development/9.1 Jul 22, 2025
26 checks passed
@bert-e bert-e deleted the bug/CLDSRV-699 branch July 22, 2025 12:40
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