OpenStack Image Registry and Delivery Service (Glance)

glance image delete of a segmented image from swift will always record a failure.

Reported by Tom Hancock on 2011-12-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Low
Brian Waldon
Diablo
Undecided
Unassigned

Bug Description

When glance creates segmented objects in a swift backend, if it decides to delete the image
it must delete the segments and the manifest. Right now the swift backend deletes the manifest
twice, once at the start and again at the end. Thus every segmented image delete
returns 404 (not found)

ie this code

                 for segment in swift_conn.get_container(obj_container,
                                                         prefix=obj_prefix)[1]:

starts with the manifest...

One fix is to add a check like this:

                  if segment['name'] == loc.obj:
                       continue

here's a glance API log

2011-11-18 15:10:31 DEBUG [glance.store.swift] Creating Swift connection with (auth_address=https://redacted:443/auth/v1.0, user=redacted:redacted, key=redacted, snet=False)
2011-11-18 15:10:33 ERROR [glance.store] Failed to delete image from store (swift+https://redacted:redacted:redacted@redacted:443/auth/v1.0/glance/217).

Brian Waldon (bcwaldon) on 2011-12-13
Changed in glance:
assignee: nobody → Brian Waldon (bcwaldon)
Tom Hancock (tom-hancock) wrote :

for what its worth I tested this change: it works fine; shall I push a change up?

Brian Waldon (bcwaldon) wrote :

Sorry, I should have checked back here before I did this review: https://review.openstack.org/#change,2294. Hopefully you buy my approach!

Changed in glance:
status: New → In Progress
importance: Undecided → Low

Reviewed: https://review.openstack.org/2294
Committed: http://github.com/openstack/glance/commit/c06242382e4de3afb67f198f86cdab76c49b00fa
Submitter: Jenkins
Branch: master

 status fixcommitted
 done

commit c06242382e4de3afb67f198f86cdab76c49b00fa
Author: Brian Waldon <email address hidden>
Date: Tue Dec 13 13:38:10 2011 -0500

    Remove extra swift delete_object call

    This only tries to delete the manifest once when deleting an image
    stored (chunked) in swift. Fixes bug 903768.

    Change-Id: I65b8f3389e9965a111c4e774f4d1b6f7bbe71a9b

Changed in glance:
status: In Progress → Fix Committed
Tom Hancock (tom-hancock) wrote :

While it does the needful, there is a small risk if the manifest will be deleted before
the segments. The original code tried to create the manifest last and delete it last.

Thierry Carrez (ttx) on 2011-12-14
Changed in glance:
milestone: none → essex-2
status: Fix Committed → Fix Released
Jay Pipes (jaypipes) wrote :

Hi Tom!

Could you explain the risk of the new code deleting the manifest before the segments? Thanks!
-jay

Reviewed: https://review.openstack.org/2865
Committed: http://github.com/openstack/glance/commit/c15c8d02085590b6a489b0fcaa9db7a8edabfc9d
Submitter: Jenkins
Branch: stable/diablo

commit c15c8d02085590b6a489b0fcaa9db7a8edabfc9d
Author: Brian Waldon <email address hidden>
Date: Tue Dec 13 13:38:10 2011 -0500

    Remove extra swift delete_object call

    This only tries to delete the manifest once when deleting an image
    stored (chunked) in swift. Fixes bug 903768.

    (cherry picked from commit c06242382e4de3afb67f198f86cdab76c49b00fa)

    Change-Id: I65b8f3389e9965a111c4e774f4d1b6f7bbe71a9b

tags: added: in-stable-diablo
Thierry Carrez (ttx) on 2012-04-05
Changed in glance:
milestone: essex-2 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers