[sqlalchemy] ttl function cause sample metadata query don't work

Bug #1419639 reported by Lan Qi song
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
In Progress
Undecided
Lan Qi song

Bug Description

My local environment:

DB backend : mysql
TTL : 1800

# nova show e27446c0-7991-4405-b0f5-882bda92c1ab
+--------------------------------------+------------------------------------------------------------+
| Property | Value |
+--------------------------------------+------------------------------------------------------------+ |
......
| metadata | {"metering.stack": "46a07745-bdd5-4993-912a-94d2a9c1a9cf"} |
+--------------------------------------+------------------------------------------------------------+

# ceilometer sample-list -m cpu_util -q 'resource_id=e27446c0-7991-4405-b0f5-882bda92c1ab'
+--------------------------------------+----------+-------+---------------+------+---------------------+
| Resource ID | Name | Type | Volume | Unit | Timestamp |
+--------------------------------------+----------+-------+---------------+------+---------------------+
| e27446c0-7991-4405-b0f5-882bda92c1ab | cpu_util | gauge | 100.0775 | % | 2015-02-09T08:01:57 |
| e27446c0-7991-4405-b0f5-882bda92c1ab | cpu_util | gauge | 99.9775 | % | 2015-02-09T07:51:57 |
| e27446c0-7991-4405-b0f5-882bda92c1ab | cpu_util | gauge | 100.068333333 | % | 2015-02-09T07:41:57 |
| e27446c0-7991-4405-b0f5-882bda92c1ab | cpu_util | gauge | 100.001666667 | % | 2015-02-09T07:31:57 |
+--------------------------------------+----------+-------+---------------+------+---------------------+

# ceilometer sample-list -m cpu_util -q metadata.user_metadata.stack=46a07745-bdd5-4993-912a-94d2a9c1a9cf
+-------------+------+------+--------+------+-----------+
| Resource ID | Name | Type | Volume | Unit | Timestamp |
+-------------+------+------+--------+------+-----------+
+-------------+------+------+--------+------+-----------+

And I noticed that all the metadata table are empty. If I understand correctly, the "id" of metadata table is related to "internal_id" of resource table, but currently, the ceilometer-expired code related the "id" of metadata table to the "id" of Sample table:
https://github.com/openstack/ceilometer/blob/master/ceilometer/storage/impl_sqlalchemy.py#L362-L366

Lan Qi song (lqslan)
Changed in ceilometer:
assignee: nobody → Lan Qi song (lqslan)
Revision history for this message
ZhiQiang Fan (aji-zqfan) wrote :
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/153950

Changed in ceilometer:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on ceilometer (master)

Change abandoned by Lan Qi Song (<email address hidden>) on branch: master
Review: https://review.openstack.org/153950
Reason: Got it, thanks Zhi Qiang

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.