fix: use multipart copy for S3 objects larger than 5 GiB #856
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.
Summary
CopyObjectAPI has a 5 GiB limit. For objects exceeding this,Copynow falls back to multipart copy usingCreateMultipartUpload+UploadPartCopy+CompleteMultipartUpload.Closes #29
Details
CopyObjectreturnsEntityTooLargeorInvalidRequestwith a "copy source is larger" message (the actual error S3 returns in practice).context.Background()so cleanup succeeds even if the parent context is cancelled.CreateMultipartUpload.ctxthrough toCopyObjectWithContext(previously unused).CI fix
Replaces the removed
bitnami/minio:2023.7.18Docker Hub image with the officialminio/minioimage run as a background container step, fixing CI that has been broken since the bitnami image was removed.Testing
isCopySourceTooLargeError(both error codes, negative cases)CopyObjectfailure →HeadObject→CreateMultipartUpload→UploadPartCopyx2 →CompleteMultipartUpload