multiple records on creating an image with location parameter.

Bug #1201386 reported by Venkatesh Sampath
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Won't Fix
Wishlist
Unassigned

Bug Description

If an image is created with a '--location' parameter, multiple records are created on image_locations table.

Steps to reproduce:

1. Fire the following command using python-glanceclient for creating a new image.

 glance image-create --name "ubuntu_13.04_desktop" --disk-format "iso" --container-format "bare" --location "http://releases.ubuntu.com/raring/ubuntu-13.04-desktop-amd64.iso"

2. python-glanceclient successfully gets the image created and shows the details for the same. eg., with image id: 1305c94a-d289-4e05-830b-fec6d2b0d682

3. Goto mysql database and fire the following queries:

mysql> select * from images where id='1305c94a-d289-4e05-830b-fec6d2b0d682'\G
*************************** 1. row ***************************
              id: 1305c94a-d289-4e05-830b-fec6d2b0d682
            name: ubuntu_13.04_desktop
            size: 823132160
          status: active
       is_public: 0
      created_at: 2013-07-15 06:27:31
      updated_at: 2013-07-15 06:27:31
      deleted_at: NULL
         deleted: 0
     disk_format: iso
container_format: bare
        checksum: NULL
           owner: 39e386d5c8db47cc9a9d80798793a162
        min_disk: 0
         min_ram: 0
       protected: 0
1 row in set (0.00 sec)

mysql> select * from image_locations where image_id='1305c94a-d289-4e05-830b-fec6d2b0d682'\G
*************************** 1. row ***************************
        id: 1684
  image_id: 1305c94a-d289-4e05-830b-fec6d2b0d682
     value: http://releases.ubuntu.com/raring/ubuntu-13.04-desktop-amd64.iso
created_at: 2013-07-15 06:27:31
updated_at: 2013-07-15 06:27:31
deleted_at: 2013-07-15 06:27:31
   deleted: 1
 meta_data:
*************************** 2. row ***************************
        id: 1685
  image_id: 1305c94a-d289-4e05-830b-fec6d2b0d682
     value: http://releases.ubuntu.com/raring/ubuntu-13.04-desktop-amd64.iso
created_at: 2013-07-15 06:27:31
updated_at: 2013-07-15 06:27:31
deleted_at: NULL
   deleted: 0
 meta_data:.
2 rows in set (0.00 sec)

Notice that under the image_locations table, there are actually mutiple records created for the same location. One soft-deleted and second one with deleted set to 0.

P.S: This scenario could be reproduced only when '--location' parameter/value is passed as an argument to the 'glance image-create' command.
Had an image been uploaded as part of the 'glance image-create' command instead of location, then mutliple records does not get created on image_locations table.

Changed in glance:
assignee: nobody → Venkatesh Sampath (venkateshsampath)
Revision history for this message
Iccha Sethi (iccha-sethi) wrote :

is this a glance client bug or glance?

Revision history for this message
Venkatesh Sampath (venkateshsampath) wrote :

This is a glance bug. This scenario is caused during the execution of 'create' method under v1/images.py.

It seems, Initially the location info gets saved as part of other image meta_data via a method called '_reserve' and at some later point of execution, the location info gets updated via a method called '_activate'. Both the '_reserve' and '_activate' method are invoked as part of 'create' operation.

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/39481

Changed in glance:
status: New → In Progress
Revision history for this message
Mark Washenberger (markwash) wrote :

This is bug report at its core expresses a desire to have less soft-deleted junk in the mysql tables. I sympathize, but its not really a bug, more of an enhancement.

Changed in glance:
importance: Undecided → Wishlist
Revision history for this message
Erno Kuvaja (jokke) wrote :

seems to be abandoned.

tags: added: propose-close
Changed in glance:
status: In Progress → New
assignee: Venkatesh Sampath (venkateshsampath) → nobody
Changed in glance:
assignee: nobody → Ankit Agrawal (ankitagrawal)
Revision history for this message
Ian Cordasco (icordasc) wrote :

I agree with Erno. This appears to be abandoned and feedback on the original review makes this seem like a dubious enhancement. Marking as "Won't Fix"

Changed in glance:
assignee: Ankit Agrawal (ankitagrawal) → nobody
status: New → Won't Fix
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.