duplicate upload image

Bug #1241379 reported by Xurong Yang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Undecided
David Koo

Bug Description

Image status change "active" to "saving" when duplicate upload image to glance,details are as follows:
create image:
curl -i -X POST -H "Content-Type:application/json" -H "X-Auth-Token:480194c5e9a046b9be8150c80c7f439b" -d '{"name":"test_img","container_format":"bare","disk_format":"qcow2","visibility":"public"}' http://127.0.0.1:9292/v2/images

upload image:
curl -i -H "Content-Type:application/octet-stream" -H "X-Auth-Token:480194c5e9a046b9be8150c80c7f439b" -X PUT -T ./test.img http://127.0.0.1:9292/v2/images/04059ffa-56fa-4f67-a294-fdc10372e634/file

duplicate upload:
curl -i -H "Content-Type:application/octet-stream" -H "X-Auth-Token:480194c5e9a046b9be8150c80c7f439b" -X PUT -T ./xx.img http://127.0.0.1:9292/v2/images/04059ffa-56fa-4f67-a294-fdc10372e634/file

Xurong Yang (idopra)
Changed in glance:
assignee: nobody → XuRong Yang (idopra)
Revision history for this message
David Koo (kpublicmail) wrote :

Clarified the bug with Yang XuRong.

What he means is that when a (duplicate) image is uploaded to an already active image the image state is changed from "active" to "saving" and stays in the "saving" state even after the image has been uploaded.

Xurong Yang (idopra)
Changed in glance:
assignee: XuRong Yang (idopra) → nobody
David Koo (kpublicmail)
Changed in glance:
assignee: nobody → koofoss (kpublicmail)
Xurong Yang (idopra)
Changed in glance:
assignee: koofoss (kpublicmail) → XuRong Yang (idopra)
status: New → In Progress
David Koo (kpublicmail)
Changed in glance:
assignee: XuRong Yang (idopra) → nobody
assignee: nobody → koofoss (kpublicmail)
Revision history for this message
Zhi Yan Liu (lzy-dev) wrote :

A related/duplicated bug report at https://bugs.launchpad.net/glance/+bug/1249409

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

Fix proposed to branch: master
Review: https://review.openstack.org/58536

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/59014

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

Reviewed: https://review.openstack.org/59014
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=0cbe012602c7d4240beaa2e4158e885a8ce7de5a
Submitter: Jenkins
Branch: master

commit 0cbe012602c7d4240beaa2e4158e885a8ce7de5a
Author: David Koo <email address hidden>
Date: Mon Jan 6 15:39:49 2014 +0800

    Restore image status on duplicate image upload

    Glance should not allow already uploaded images to be modified by
    another upload. Currently, when configured with the local filesystem
    backend, Glance prevents duplicate upload of an already uploaded image
    BUT it changes the image status to "saving".

    This commit adds a status transition state machine to the domain.Image
    class and modifies the domain.Image.status setter function to verify
    status transitions based on this state machine - only target states that
    can be reached from the image's current state are permitted.

    Tests have also been agumented to verify that the original image (meta)
    data does not change in case of a conflicting upload.

    Closes-Bug: #1241379

    Change-Id: I62c5acae4c29abf0691d8279b51c59008f9c0047

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: none → icehouse-3
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (stable/havana)

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/81733

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/82725

Thierry Carrez (ttx)
Changed in glance:
milestone: icehouse-3 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers