Etag in HEAD or GET of a segmented file (manifest) does not work as documented

Bug #873133 reported by Sabya
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Low
John Dickinson

Bug Description

The documentation says:

The response’s ETag for a GET or HEAD on the manifest file will be the MD5 sum of the concatenated string of ETags for each of the segments in the <container>/<prefix> listing, dynamically.

However, that has not been the case in my tests. I found that quotes were being inserted between the etag strings before concatenating. The following patch should fix this.

=== modified file 'swift/proxy/server.py'
--- swift/proxy/server.py 2011-08-12 13:33:42 +0000
+++ swift/proxy/server.py 2011-10-13 00:30:41 +0000
@@ -854,7 +854,7 @@
                     last_modified = datetime(*map(int, re.split('[^\d]',
                         last_modified)[:-1]))
                     etag = md5(
- '"'.join(o['hash'] for o in listing)).hexdigest()
+ ''.join(o['hash'] for o in listing)).hexdigest()
                 else:
                     content_length = 0
                     last_modified = resp.last_modified

Revision history for this message
Sabya (ssgosh) wrote :
Changed in swift:
status: New → Confirmed
Changed in swift:
importance: Undecided → Low
milestone: none → 1.4.4
assignee: nobody → John Dickinson (notmyname)
Revision history for this message
Juan J. Martínez (jjmartinez) wrote :

Any plans to ship this patch in 1.4.4?

It doesn't look to me like a low priority bug that the actual etag returned by the manifest is wrong ;)

Revision history for this message
John Dickinson (notmyname) wrote :

There is a patch waiting to land.

https://review.openstack.org/#change,1558

If it gets approved by Wednesday (Nov 16), it will be in swift 1.4.4.

Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to swift (master)

Reviewed: https://review.openstack.org/1558
Committed: http://github.com/openstack/swift/commit/b571d56d364ad2f7d3029f3072599c6671492c68
Submitter: Jenkins
Branch: master

 status fixcommitted
 done

commit b571d56d364ad2f7d3029f3072599c6671492c68
Author: John Dickinson <email address hidden>
Date: Fri Nov 11 13:55:58 2011 -0600

    fixed object manifest etags

    fixes lp bug #873133

    Change-Id: Ic371b1e5d858a87dfdb7e28f888f9f3bbd60e661

Changed in swift:
status: Confirmed → Fix Committed
Thierry Carrez (ttx)
Changed in swift:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Patches

Remote bug watches

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