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

Inconsistent ETag on complete multipart upload POST response #855

Closed
hectcastro opened this issue May 12, 2014 · 2 comments
Closed

Inconsistent ETag on complete multipart upload POST response #855

hectcastro opened this issue May 12, 2014 · 2 comments
Assignees
Labels
Milestone

Comments

@hectcastro
Copy link
Contributor

When completing a multipart upload against Amazon S3, the XML payload contains a specialized ETag:

<?xml version="1.0" encoding="UTF-8"?>
<CompleteMultipartUploadResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
   <Location>http://joker-test.s3.amazonaws.com/25.txt</Location>
   <Bucket>joker-test</Bucket>
   <Key>25.txt</Key>
   <ETag>"6ce4f6859aaecc0e7f23fc487c31f8db-2"</ETag>
</CompleteMultipartUploadResult>

According to a response from an Amazon employee on their support forums, this ETag is:

The checksum in a multipart digest is the MD5 of the concatenated MD5 bytes of each of the parts affixed with the number of parts

Basically:

ETag = MD5(Sum(p \in numberParts, MD5(PartBytes(p))) + "-" + numberParts

In this example, I uploaded a 25MB file in chunks of 20MB, so the numberParts part of that adds up. I also used an S3 client for Go that calculates the MD5 of the concatenated MD5 bytes for each part, and that is consistent as well.

When completing a similar multipart upload against Riak CS, the ETag attribute looks different (it actually looks like the UploadId):

<?xml version="1.0" encoding="UTF-8"?>
<CompleteMultipartUploadResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
   <Location>http://isos.s3.amazonaws.com/25.txt</Location>
   <Bucket>isos</Bucket>
   <Key>25.txt</Key>
   <ETag>oD_XfZorRXOY6ouY61cFMA==</ETag>
</CompleteMultipartUploadResult>

Response from multipart upload initialization to show that the ETag is the UploadId:

<?xml version="1.0" encoding="UTF-8"?>
<InitiateMultipartUploadResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
   <Bucket>isos</Bucket>
   <Key>25.txt</Key>
   <UploadId>oD_XfZorRXOY6ouY61cFMA==</UploadId>
</InitiateMultipartUploadResult>

Unfortunately, clients who use this ETag to confirm that all of the parts in a multipart upload request completed successfully are not able to do so against Riak CS.

@hectcastro hectcastro added the Bug label May 12, 2014
@kuenishi kuenishi added this to the 1.5.1 milestone May 20, 2014
@kuenishi kuenishi modified the milestones: 1.5.0, 1.5.1 Jun 4, 2014
@kuenishi kuenishi self-assigned this Jun 12, 2014
This was referenced Jun 16, 2014
@kuenishi
Copy link
Contributor

fixed by #887

kuenishi added a commit that referenced this issue Jun 16, 2014
borshop added a commit that referenced this issue Jun 16, 2014
Add release note on #855 fix

Reviewed-by: shino
@hectcastro
Copy link
Contributor Author

Nice. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants