Metrics ain't deleted when corresponding resource is deleted

Bug #1524666 reported by Yurii Prokulevych
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gnocchi
Fix Released
Critical
Unassigned
1.3
Fix Released
Critical
Unassigned

Bug Description

After resource is deleted its metrics still resist in the DB preventing removing of their archive policy.

Steps to reproduce:
1. Create archive-policy:
gnocchi archive-policy create -b 0 -m min -m max -m mean -m count -d points:3,timespan:900 -d points:5,granularity:60 -d timespan:3600,granularity:180 AutoTestResourcePolicy-32121

2. Create generic resource with custom metrics:
gnocchi resource create -t generic -n 'Metric1:AutoTestResourcePolicy-32121' -n 'Metric2:AutoTestResourcePolicy-32121' f53bb4c4-e53b-4a4d-b5c1-22449088f6d9

3. Assert resource and archive-policy exist
    gnocchi archive-policy list
    gnocchi resource list

4. Delete resource:
    gnocchi resource delete f53bb4c4-e53b-4a4d-b5c1-22449088f6d9

5. Try to delete archive-policy
    gnocchi archive-policy delete AutoTestResourcePolicy-32121
    Archive policy AutoTestResourcePolicy-32121 is still in use (HTTP 400)

In gnocchi DB:
select name,archive_policy_name from metric;
+----------------+------------------------------+
| name | archive_policy_name |
+----------------+------------------------------+
| image.serve | low |
| image.size | low |
| FakeMeter3 | low |
| image | low |
| image.download | low |
| FakeMeter1 | low |
| Metric2 | AutoTestResourcePolicy-32121 |
| Metric1 | AutoTestResourcePolicy-32121 |
| FakeMeter2 | low |
+----------------+------------------------------+

Packages: 1.3.0-5
Client: 2.0.0-1

Regards,
Yurii

Revision history for this message
Julien Danjou (jdanjou) wrote :
Changed in gnocchi:
status: New → Confirmed
importance: Undecided → Critical
status: Confirmed → Fix Committed
Julien Danjou (jdanjou)
Changed in gnocchi:
milestone: none → 2.0.0
status: Fix Committed → Fix Released
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.