Improve handling of checksum for multipart objects

Bug #1697741 reported by Charles Farquhar
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Swift3
Fix Released
Undecided
Unassigned

Bug Description

Some S3 client libraries (i.e. JetS3t) send an Etag/Content-Md5 header when initiating a multi-part object upload. The S3 API reference [1] does not mention sending this header, but the S3 API appears to ignore it. However, the swift3 implementation evaluates the client-provided header and compares it to the empty body of the multi-part object initiation request. This results in the upload failing.

It would be better for the swift3 middleware to behave the same way as S3 when receiving the Etag/Content-Md5 header during multi-part upload initiation.

[1] http://docs.aws.amazon.com/AmazonS3/latest/API/mpUploadInitiate.html

Revision history for this message
Charles Farquhar (cfarquhar) wrote :

I must have missed something when submitting the patch as the review wasn't linked here. A proposed solution can be found at https://review.openstack.org/#/c/473939/ .

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift3 (master)

Reviewed: https://review.openstack.org/473939
Committed: https://git.openstack.org/cgit/openstack/swift3/commit/?id=5b8c15d6801b48e15d08b05a1c35611196ca34d9
Submitter: Jenkins
Branch: master

commit 5b8c15d6801b48e15d08b05a1c35611196ca34d9
Author: Charles Farquhar <email address hidden>
Date: Tue Jun 13 13:12:58 2017 -0500

    Ignore md5sum header during multi-part upload init

    Some S3 client libs send an Etag/Content-Md5 header during multi-part object
    initialization. The S3 API reference does not mention how the MD5 checksum
    header is treated at this stage, and the API itself appears to ignore the
    headers.

    Prior to this commit, swift3 passed the headers on, which were later compared
    to the md5sum of the request's body, which is always empty. This results in the
    upload failing when the client-supplied checksum (generally the checksum for the
    entire object) does not match the checksum for a null object.

    After this commit, the Etag and Content-Md5 headers are ignored during the
    multi-part initialization phase. This mimics the behavior of AWS' S3 API.

    Closes-Bug: 1697741
    Change-Id: I2cb5376994bf270890bd9b06ec2bf521350c826d

Changed in swift3:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.