Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix complete MPU with missing parts #5691

Merged
merged 9 commits into from
Nov 18, 2024

Conversation

KillianG
Copy link
Contributor

@KillianG KillianG commented Oct 29, 2024

In case of a complete MPU error after the storage of the object MD, the abort must delete object MDs and object Data, some part may have been deleted already in the MPU metadata, hence we need to verify in the object MD for the parts it's linked to, to avoid creating orphans

Issue: CLDSRV-570

@bert-e
Copy link
Contributor

bert-e commented Oct 29, 2024

Hello killiang,

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.

@KillianG KillianG force-pushed the improvement/CLDSRV-570-fix-complete-mpu branch 2 times, most recently from 6845b72 to a30b1c6 Compare October 29, 2024 12:41
@scality scality deleted a comment from bert-e Oct 29, 2024
@bert-e
Copy link
Contributor

bert-e commented Oct 29, 2024

Waiting for approval

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

  • the author

  • 2 peers

In case of a complete MPU error after the storage of the object MD, the abort must delete object MDs and object Data, some part may have been deleted already in the MPU metadata, hence we need to verify in the object MD for the parts it's linked to, to avoid creating orphans

Issue: CLDSRV-570
@KillianG KillianG force-pushed the improvement/CLDSRV-570-fix-complete-mpu branch from a30b1c6 to cb95908 Compare November 13, 2024 17:28
@KillianG KillianG marked this pull request as draft November 13, 2024 17:30
@KillianG KillianG marked this pull request as ready for review November 14, 2024 16:13
tests/unit/api/multipartUpload.js Outdated Show resolved Hide resolved
lib/api/apiUtils/object/abortMultipartUpload.js Outdated Show resolved Hide resolved
lib/api/apiUtils/object/abortMultipartUpload.js Outdated Show resolved Hide resolved
@KillianG KillianG force-pushed the improvement/CLDSRV-570-fix-complete-mpu branch from 558e17b to bc34e74 Compare November 15, 2024 13:55
@KillianG KillianG force-pushed the improvement/CLDSRV-570-fix-complete-mpu branch from 4b578f2 to 0b46258 Compare November 18, 2024 13:02
…on and MD orphans

Remove duplicated import in tests

Issue: CLDSRV-570
@KillianG KillianG force-pushed the improvement/CLDSRV-570-fix-complete-mpu branch from 046a124 to a934fe1 Compare November 18, 2024 13:27
@@ -98,6 +126,13 @@ function abortMultipartUpload(authInfo, bucketName, objectKey, uploadId, log,
}
// flatten the array
locations = [].concat(...locations);

if (objectMD?.location) {
const objectLocationLeft = objectMD.location.filter(loc =>
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: "left" looks like the directoin, maybe best to rename to something more intuitive, maybe remainingObjectLocations

more importantly, this can be quite CPU intensive for large objects (n^2 complexity, with n up to 10000): need to make this more efficient...

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a more optimized approach for this would be to use a map ?

if (objectMD?.location) {
    const locationMap = new Map(locations.map(loc => [loc.key, true]));
    const objectLocationLeft = objectMD.location.filter(loc => !locationMap.has(loc.key));
    locations = locations.concat(objectLocationLeft);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

since we are building a list of locations, maybe we could directly use a map instead (and pass it to async.eachLimit directly, to process each "pair"?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed a more optimized version here
e9ae9c2

FOr locations being a Set directly, I can do it, but as we'll need to map over it anyway for getting keys, we'll end up needing an array (as map function does not exist for Sets)

@KillianG KillianG force-pushed the improvement/CLDSRV-570-fix-complete-mpu branch from 24477ba to c7c7ba1 Compare November 18, 2024 15:33
@KillianG KillianG force-pushed the improvement/CLDSRV-570-fix-complete-mpu branch from c7c7ba1 to d13a6f3 Compare November 18, 2024 15:38
@KillianG
Copy link
Contributor Author

/approve

@bert-e
Copy link
Contributor

bert-e commented Nov 18, 2024

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

  • ✔️ development/8.8

The following branches have NOT changed:

  • development/7.10
  • development/7.4
  • development/7.70
  • development/8.6
  • development/8.7

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

Goodbye killiang.

The following options are set: approve

@bert-e bert-e merged commit d13a6f3 into development/8.8 Nov 18, 2024
16 checks passed
@bert-e bert-e deleted the improvement/CLDSRV-570-fix-complete-mpu branch November 18, 2024 16:44
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.

6 participants