Skip to content
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

Support multiple send's with leavePartsOnError #634

Merged
merged 1 commit into from Sep 28, 2015

Conversation

dconnolly
Copy link
Contributor

Track which parts have been uploaded and if we have an ETag for them, don't try to upload them again. This works well with leavePartsOnError, so that you can restart a failed upload and only upload the missing parts.

This passes existing sdk tests and works well with buffer/file-type uploads. I don't think this is a use case for uploading streams, but it doesn't conflict with that case.

Fixes #633

Track which parts have been uploaded and if we have an ETag for them,
don't try to upload them again. This works well with
`leavePartsOnError`, so that you can restart a failed upload and only
upload the missing parts.
@dconnolly
Copy link
Contributor Author

@lsegal thoughts?

@dconnolly
Copy link
Contributor Author

@AdityaManohar @lsegal bump? We've been using this in production for almost a month with success.

@@ -522,7 +532,7 @@ AWS.S3.ManagedUpload = AWS.util.inherit({
*/
finishMultiPart: function finishMultiPart() {
var self = this;
var completeParams = { MultipartUpload: { Parts: self.completeInfo } };
var completeParams = { MultipartUpload: { Parts: self.completeInfo.slice(1) } };
Copy link
Contributor

Choose a reason for hiding this comment

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

@dconnolly Is there a reason that we are slicing out the first index here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are slicing as we are following the pattern of keeping track of parts by the correctly indexed key, ie: part 1 has key value 1, and key 0 is null, so we slice it out. Somehow this worked without slicing (before this change) on the first upload pass, but any 'resumed' uploads get into a weird state when trying to push all the parts again.

@AdityaManohar
Copy link
Contributor

@dconnolly I will look into adding some tests for this and then merge it in if everything looks good.

@dconnolly
Copy link
Contributor Author

That's great, thank you.

@lonormaly
Copy link

+1(!!) Let's support pause / resume
@dconnolly Can you please provide an example of how to use (leavePartsOnError) this great feature?

@lonormaly
Copy link

@dconnolly I've been using your version for some time now, works great!
Question: is there a way to abort an upload and to force clean the uploaded parts even when using the leavePartsOnError?

@chrisradek chrisradek merged commit 0af1953 into aws:master Sep 28, 2015
@lock
Copy link

lock bot commented Sep 28, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resume multipart upload with 'leavePartsOnError'?
4 participants