Skip to content

Implement multipart copy for s3#44

Open
johha wants to merge 1 commit intomainfrom
s3-multipart-copy
Open

Implement multipart copy for s3#44
johha wants to merge 1 commit intomainfrom
s3-multipart-copy

Conversation

@johha
Copy link
Contributor

@johha johha commented Feb 13, 2026

AWS S3 requires multipart copy for files larger than 5GB. Other providers might have different levels thus this value is configurable.

@johha johha marked this pull request as ready for review February 13, 2026 09:35
@johha johha requested review from a team, Sascha-Stoj and gururajsh and removed request for a team February 13, 2026 09:45
@johha johha force-pushed the s3-multipart-copy branch from dc253e5 to d316e32 Compare February 13, 2026 12:31
// multipartCopy performs a multipart copy using CreateMultipartUpload, UploadPartCopy, and CompleteMultipartUpload
func (b *awsS3Client) multipartCopy(copySource string, dstBlob string, objectSize int64, copyPartSize int64) error {
cfg := b.s3cliConfig
numParts := int((objectSize + copyPartSize - 1) / copyPartSize)
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe adding a comment in here makes more clear how the number of parts are calculated
example: ceiling division formula
and alternative formula ((objectSize - 1) / o.copyPartSize) + 1

return errors.New("object content length is nil")
}

objectSize := *headOutput.ContentLength
Copy link
Contributor

@serdarozerr serdarozerr Feb 13, 2026

Choose a reason for hiding this comment

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

could be better to return if objectSize is 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants