image-delete fires multiple queries to delete its child entries

Bug #1201758 reported by Venkatesh Sampath
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Wishlist
Zhi Yan Liu

Bug Description

While deleting an image all its child entries are also deleted.

Child entries types are image_locations, image_properties, image_members and image_tags

Currently, for deleting the child entries the following is done:
1. Fire a select query to fetch the child entries.
2. Enumerate through the entries and fire soft-delete (update query) on each child entry seperately.

If the number of child entries grows higher, then the amount of queries fired to delete them grows equally higher essentially increasing the response time for image delete.

This impelementation can be changed to fire one db query for all the child entries corresponding to a particular child entry type.

eg., instead of invoking model.soft_delete(), we can use model_query(CHILD_ENTRY_TYPE).filter(some_condition).soft_delete().

Changed in glance:
assignee: nobody → Venkatesh Sampath (venkateshsampath)
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/37214

Changed in glance:
status: New → In Progress
Changed in glance:
status: In Progress → Confirmed
importance: Undecided → Wishlist
Changed in glance:
status: Confirmed → In Progress
Changed in glance:
assignee: Venkatesh Sampath (venkateshsampath) → Zhi Yan Liu (lzy-dev)
Zhi Yan Liu (lzy-dev)
Changed in glance:
assignee: Zhi Yan Liu (lzy-dev) → nobody
Revision history for this message
Zhi Yan Liu (lzy-dev) wrote :

Hello venkateshsampath since I have commit a change (#41311) which base on you this commit (#37214), that caused Hudson reassign this item to me automatically. I have tried to correct it and reassign this to you but seems I can do that successful. I'm sorry for this.

Changed in glance:
assignee: nobody → Zhi Yan Liu (lzy-dev)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

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

commit c7e9786aa777eb6a44a9b9350da587546c347c7a
Author: Venkatesh Sampath <email address hidden>
Date: Tue Jul 16 16:27:09 2013 +0530

    image-delete fires multiple queries to delete its child entries

    1. Changed individual query calls for soft-deleting the image's
       child entries to one db query call for all child entries of a
       given type.
    2. Added a fix to simple db's 'image_destroy' api to clear
       the location entries.

    Fixes bug 1201758

    Change-Id: Ib673de5460d59ea3af74553048ffcf74dccbdc36

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: none → havana-3
status: Fix Committed → Fix Released
Revision history for this message
Yang Yu (yuyangbj) wrote : I will be on vacation from 9/5 to 9/15, urgent call: 13811509950

I will be out of the office starting 2013-09-05 and will not return until
2013-09-15.

I will be on my marriage leave from 9/5 to 9/15, for any urgent issue
please call me before 9/7.

For daily work, please ask my scrum master Zhu Zhu for help.
For glance issue, please ask glance SME Feilong Wang for help.
For defect report, there will be no report next week.

Thierry Carrez (ttx)
Changed in glance:
milestone: havana-3 → 2013.2
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.