S3 Cache: Use multipart upload instead of CopyObject for touching file > 5GB#5266
Merged
tonistiigi merged 1 commit intomoby:masterfrom Aug 22, 2024
Merged
S3 Cache: Use multipart upload instead of CopyObject for touching file > 5GB#5266tonistiigi merged 1 commit intomoby:masterfrom
tonistiigi merged 1 commit intomoby:masterfrom
Conversation
b713f47 to
74289cf
Compare
tonistiigi
reviewed
Aug 21, 2024
| currentPosition += maxCopyObjectSize | ||
| } | ||
|
|
||
| CompleteMultipartUploadInput := &s3.CompleteMultipartUploadInput{ |
Member
There was a problem hiding this comment.
nit: local variable should be lowercase
| Parts: completedParts, | ||
| }, | ||
| } | ||
| _, completeErr := s3Client.CompleteMultipartUpload(ctx, CompleteMultipartUploadInput) |
Member
There was a problem hiding this comment.
just if err := s3Client.Comp.. would do
| Key: &key, | ||
| UploadId: output.UploadId, | ||
| } | ||
| _, errAbort := s3Client.AbortMultipartUpload(ctx, &abortIn) |
Member
There was a problem hiding this comment.
Maybe this should be in defer with a err != nil condition. Eg. let's say context gets canceled while CompleteMultipartUpload is issued.
tonistiigi
requested changes
Aug 21, 2024
| Key: &key, | ||
| UploadId: output.UploadId, | ||
| } | ||
| if err != nil { |
Member
There was a problem hiding this comment.
This requires err to be named return value as well.
…g file > 5GB Signed-off-by: Bertrand Paquet <[email protected]>
tonistiigi
approved these changes
Aug 22, 2024
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.
Fix #4885
Tested locally with this Dockerfile
And with the
touch_refreshoption set to 10s.