feat(storage:s3): multi-part upload: upload parts concurrently#272
Open
feat(storage:s3): multi-part upload: upload parts concurrently#272
Conversation
a78f09a to
d8d9f7d
Compare
AnatolyPopov
requested changes
Jun 14, 2023
storage/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3MultiPartOutputStream.java
Outdated
Show resolved
Hide resolved
6cb6301 to
3db7869
Compare
storage/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3MultiPartOutputStream.java
Outdated
Show resolved
Hide resolved
3db7869 to
0c67b5c
Compare
storage/s3/src/main/java/io/aiven/kafka/tieredstorage/storage/s3/S3MultiPartOutputStream.java
Outdated
Show resolved
Hide resolved
9088b6f to
fb3f9df
Compare
fb3f9df to
2254ec1
Compare
AnatolyPopov
requested changes
Jun 15, 2023
...ge/s3/src/test/java/io/aiven/kafka/tieredstorage/storage/s3/S3MultiPartOutputStreamTest.java
Outdated
Show resolved
Hide resolved
2254ec1 to
a0bcd0e
Compare
708cc14 to
004908c
Compare
004908c to
8152054
Compare
ivanyu
requested changes
Jun 19, 2023
Contributor
There was a problem hiding this comment.
This approach has a drawback: we can't realistically use big part sizes. We need to target some 100 MB part sizes. With uncontrollable parallelism + memory arrays, this is not going to end well. Mainly we need to get rid of memory arrays and stream data directly from disk.
Ideally we should have something like this:
- Split the file into parts, virtually, just ranges.
- Upload parts in parallel from file-based InputStreams (applying transfomations, of course).
- Control parallelism, we need an explicit configurable number.
- Recombine the chunk index in the end, should be simple arithmetics.
- Some mechanism for cancelling all parallel uploads if one of them fails (maybe we don't need this if S3 starts rejecting uploads promptly enough after the multipart upload has been cancelled).
This will lead to changing some interfaces + making it required that the chunks size is a multiple of the chunk size.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uses
CompletableFutureto run upload parts requests concurrently, and improve upload performance.Resolves: #125