The alarm history should be deleted when deleting a alarm

Bug #1476883 reported by Liusheng
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Aodh
Fix Released
Medium
Liusheng
Ceilometer
Fix Released
Medium
Liusheng

Bug Description

The alarms history record the actions of alarms, the actions include creation, rule change, state transition and deletion. But, after deleting a alarm, the alarm will be deleted in storage backend (using mysql) and the alarm's history will still be stored in storage, there is no other solution to query the deleted alarm's history except querying the alarm id in alarm_history db table manually, because we need specifying alarm_id to query alarm history.

FYI: https://review.openstack.org/#/c/203964/

Liusheng (liusheng)
Changed in ceilometer:
assignee: nobody → Liusheng (liusheng)
Revision history for this message
Liusheng (liusheng) wrote :

When I try to fix this issue, I realized that the complex query API can query the alarm history of a deleted alarm. but that way is also not convenient to query alarm history of a specified alarm, because we need to know the alarm_id firstly. So I am not sure this a is actually a issue need to be fix ?

Revision history for this message
Julien Danjou (jdanjou) wrote :

IIUC you're saying that we can't actually use that feature neither? So let's go ahead and do it then, right?

Revision history for this message
Liusheng (liusheng) wrote :

Hi Julien, I mean the alarm history complex query API support flexible query rule, unlike the alarm-history API which require the alarm_id as parameter, So I am not sure is there any use case need to query alarm history by project_id, user_id, timestamp, etc. with complex query API whether the alarms have been deleted or not. what do you think ?

Revision history for this message
Julien Danjou (jdanjou) wrote :

I'd stick with my position, I don't think retrieving data from deleted alarm is worth it. If you want to keep that data, just don't delete the alarm and just deactivate it. :)

Revision history for this message
Liusheng (liusheng) wrote :

my personal view is same to you : ), just consider others possibility, I will upload patch for this.

Revision history for this message
Liusheng (liusheng) wrote :
Liusheng (liusheng)
affects: ceilometer → aodh
Changed in aodh:
status: New → Fix Committed
Thierry Carrez (ttx)
Changed in aodh:
milestone: none → 1.0.0
status: Fix Committed → Fix Released
gordon chung (chungg)
Changed in ceilometer:
status: New → Triaged
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/226151

Changed in ceilometer:
assignee: nobody → Liusheng (liusheng)
status: Triaged → In Progress
Changed in ceilometer:
assignee: Liusheng (liusheng) → gordon chung (chungg)
gordon chung (chungg)
Changed in ceilometer:
assignee: gordon chung (chungg) → Liusheng (liusheng)
importance: Undecided → Medium
gordon chung (chungg)
Changed in ceilometer:
milestone: none → liberty-rc1
Changed in aodh:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

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

commit e20c2fcf196f9d9eebc13ef04f440a4240e2e843
Author: liusheng <email address hidden>
Date: Tue Sep 22 11:02:10 2015 +0800

    Delete its corresponding history data when deleting an alarm

    The history data of an alarm will still be stored in storage after the
    alarm being deleted. that is easy to cause residue issue.

    taken from: I5f6d7a1998104335079b7988e3d0b929b8854b28

    Change-Id: I4ceb3de37640de6ba1534e70735410333810a488
    Closes-Bug: #1476883

Changed in ceilometer:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: liberty-rc1 → 5.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.