-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
S3 Cache: Use multipart upload instead of CopyObject for touching file > 5GB #5266
Conversation
b713f47
to
74289cf
Compare
cache/remotecache/s3/s3.go
Outdated
currentPosition += maxCopyObjectSize | ||
} | ||
|
||
CompleteMultipartUploadInput := &s3.CompleteMultipartUploadInput{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: local variable should be lowercase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
cache/remotecache/s3/s3.go
Outdated
Parts: completedParts, | ||
}, | ||
} | ||
_, completeErr := s3Client.CompleteMultipartUpload(ctx, CompleteMultipartUploadInput) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just if err := s3Client.Comp..
would do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
cache/remotecache/s3/s3.go
Outdated
Key: &key, | ||
UploadId: output.UploadId, | ||
} | ||
_, errAbort := s3Client.AbortMultipartUpload(ctx, &abortIn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should be in defer with a err != nil
condition. Eg. let's say context gets canceled while CompleteMultipartUpload
is issued.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Key: &key, | ||
UploadId: output.UploadId, | ||
} | ||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This requires err
to be named return value as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
…g file > 5GB Signed-off-by: Bertrand Paquet <[email protected]>
Fix #4885
Tested locally with this Dockerfile
And with the
touch_refresh
option set to 10s.