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

Improve multipart upload #12514

Merged
merged 4 commits into from
Jun 16, 2021

Conversation

klauspost
Copy link
Contributor

@klauspost klauspost commented Jun 16, 2021

Description

Each multipart upload is holding a read lock for the entire upload duration of each part.

This makes it impossible for other parts to complete until all currently uploading parts have released their locks.

It will also make it impossible for new parts to start as long as on write lock is still being requested, essentially deadlocking uploads until all that may have been granted a read lock has completed.

Refactor to only hold the upload id lock while reading and writing the metadata, but hold a part id lock while the part is being uploaded.

Possible improvement for #12472

How to test this PR?

Single multipart uploads, with limited connection throughput.

Types of changes

  • Optimization (provides speedup with no functional changes)

Each multipart upload is holding a read lock for the entire upload duration of each part.

This makes it impossible for other parts to complete until all currently uploading parts have released their locks.

It will also make it impossible for new parts to start as long as on write lock is still being requested, essentially deadlocking uploads until all that may have been granted a read lock has completed.

Refactor to only hold the upload id lock while reading and writing the metadata, but hold a part id lock while the part is being uploaded.
@klauspost klauspost requested a review from vadmeste June 16, 2021 08:41
@klauspost klauspost marked this pull request as ready for review June 16, 2021 12:11
cmd/erasure-sets.go Outdated Show resolved Hide resolved
cmd/erasure-multipart.go Show resolved Hide resolved
cmd/erasure-sets.go Outdated Show resolved Hide resolved
cmd/utils.go Outdated Show resolved Hide resolved
@minio-trusted
Copy link
Contributor

Mint Automation

Test Result
mint-large-bucket.sh ✔️
mint-fs.sh ✔️
mint-gateway-s3.sh ✔️
mint-erasure.sh ✔️
mint-dist-erasure.sh ✔️
mint-zoned.sh ✔️
mint-gateway-nas.sh ✔️
mint-compress-encrypt-dist-erasure.sh ✔️
Deleting image on docker hub
Deleting image locally

Copy link
Member

@vadmeste vadmeste left a comment

Choose a reason for hiding this comment

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

LGTM

@harshavardhana harshavardhana merged commit 33cee9f into minio:master Jun 16, 2021
@klauspost klauspost deleted the multipart-concurrent-uploads branch June 18, 2021 11:26
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.

None yet

4 participants