Should swift backend compute size if none is specified?
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Fix Released
|
Medium
|
Paul Bourke | ||
Diablo |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
From an email I posted to the mailing list yesterday
=======
We ran into a backward compat issue closely related to this last week.
If the newer Glance code in Diablo is running on a server configured with a Swift backend and interacting with an older Glance client on an older Nova system that doesn't set content-length then (even assuming the image is < 5GB) it gets stored in the backend using the usual means, but the image size in the registry is never set correctly.
These few lines were in the pre-diablo code to do a HEAD on the object in swift if the size was unknown and if they're re-added then the registry gets updated with the correct length. It looks like this still applies to essex.
regards,
Tom
-------
# best...
+ if image_size == 0:
+ resp_headers = swift_conn.
+ # header keys are lowercased by Swift
+ if 'content-length' in resp_headers:
+ image_size = int(resp_
+ logger.
+ object size to %s") % image_size)
else:
# Write the image into Swift in chunks. We cannot
# stream chunks of the webob.Request.
Changed in glance: | |
status: | Triaged → Fix Committed |
Changed in glance: | |
status: | Fix Committed → Fix Released |
Changed in glance: | |
milestone: | essex-2 → 2012.1 |
Tom, I'm going to have to get you used to proposing patches in Gerrit ;)
Thanks for the patch. I'll assign this to someone, and also, Ewan's idea about if image_size = 0, then do the segmented manifest upload make a lot of sense. Not sure why that didn't occur to me earlier, but oh well!
-jay