[sqlalchemy] clear_expired_metering_data didn't honor the newly added contraints

Bug #1258071 reported by Lianhao Lu
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
High
gordon chung

Bug Description

The impl_sqlalchemy.Connection.clear_expired_metering_data() method was added quite some time ago, and it doesn't honor the following new added constraints :

- all metadata_xxx tables have foreign key constraints to meter.id
- alarm table has foreign key constraints to project.id and user.id.

Julien Danjou (jdanjou)
Changed in ceilometer:
status: New → Triaged
importance: Undecided → High
Revision history for this message
gordon chung (chungg) wrote :

nice catch. i guess i should've put cascade on delete when i added metadata tables...

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

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

Changed in ceilometer:
assignee: nobody → gordon chung (chungg)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/60995
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=13764537a465b05b4d7fa864d30c81f7192d2490
Submitter: Jenkins
Branch: master

commit 13764537a465b05b4d7fa864d30c81f7192d2490
Author: Gordon Chung <email address hidden>
Date: Mon Dec 9 17:53:04 2013 -0500

    add newly added constraints to expire clear_expired_metering_data

    - cascade deletes to metadata tables on meter deletion
    - delete associations on object deletion
    - add check to not delete user/project entries associated with Alarm

    Change-Id: I24cbaea9ede6d142dc22eaf070b3f7d1f14b484a
    Closes-Bug: #1258071

Changed in ceilometer:
status: In Progress → Fix Committed
gordon chung (chungg)
Changed in ceilometer:
milestone: none → icehouse-2
Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: icehouse-2 → 2014.1
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.