lbaas: delete_health_monitor() should rely upon cascade operations

Bug #1169107 reported by Roman Podoliaka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Roman Podoliaka

Bug Description

In LBaaS DB schema we have a Pool <--> HealthMonitor many-to-many association which is done
via the PoolMonitorAssociation model.

A HealthMonitor instance may be deleted by calling the "delete_health_monitor()" method
which is defined in quantum/db/loadbalancer/loadbalancer_db module.

Currently, this method performs a "manual" deletion of a HealthMonitor instance given its id:
it gets a list of all PoolMonitorAssociation instances filtered by a HealthMonitor id, for each of those
instances it retrieves a corresponding Pool instance and finally removes the association instance
from the "monitors" collection of a Pool instance.

We can simplify the deletion of HealthMonitor instances by relying upon cascade operations
defined for SQLAlchemy relationships (which is already done for Pool model).

Tags: db lbaas
Changed in quantum:
assignee: nobody → Roman Podolyaka (rpodolyaka)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to quantum (master)

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

Changed in quantum:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to quantum (master)

Reviewed: https://review.openstack.org/26959
Committed: http://github.com/openstack/quantum/commit/ee50162b27a3e0bf310f8e4f273b69cd0660cf69
Submitter: Jenkins
Branch: master

commit ee50162b27a3e0bf310f8e4f273b69cd0660cf69
Author: Roman Podolyaka <email address hidden>
Date: Mon Apr 15 18:10:07 2013 +0300

    Simplify delete_health_monitor() using cascades

    Currently delete_health_monitor() emulates behaviour of
    cascade deletion: when a HealthMonitor instance is deleted,
    all corresponding PoolMonitorAssociations are queried and
    deleted one by one. This can be done automatically by means
    of SQLAlchemy if we set proper cascade flags on the relationship
    between HealthMonitor and PoolMonitorAssociations models.

    Fixes bug 1169107.

    Change-Id: I674c381192719a56433f67be53a32203c36ebe2b

Changed in quantum:
status: In Progress → Fix Committed
Changed in quantum:
milestone: none → havana-1
Thierry Carrez (ttx)
Changed in quantum:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: havana-1 → 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.