query-samples timeout in middle scale data set
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ceilometer |
Fix Released
|
Undecided
|
ZhiQiang Fan | ||
Kilo |
Fix Released
|
Undecided
|
ZhiQiang Fan | ||
Liberty |
Fix Released
|
Undecided
|
ZhiQiang Fan |
Bug Description
currently, when we call query-samples API, for sql backend, we do a inner join to get a temp table, then apply filters, orderby and limit options on it, which will drain disk space or timeout exception when data set is growing.
my test shows that timeout exception raises even when sample table row is 500K, even limit=1 is specified, and there is only one request is processing.
for i.e., the sql statement generated for "ceilometer query-samples --limit 1" is:
SELECT anon_1.id AS anon_1_id, anon_1.counter_name AS anon_1_
FROM (SELECT sample.id AS id, meter.name AS counter_name, meter.type AS counter_type, meter.unit AS counter_unit, sample.volume AS counter_volume, resource.
FROM sample INNER JOIN meter ON sample.meter_id = meter.id INNER JOIN resource ON sample.resource_id = resource.
LIMIT 1
actually, it should be:
SELECT sample.id AS id, meter.name AS counter_name, meter.type AS counter_type, meter.unit AS counter_unit, sample.volume AS counter_volume, resource.
FROM sample INNER JOIN meter ON sample.meter_id = meter.id INNER JOIN resource ON sample.resource_id = resource.
LIMIT 1
the second one can response in less than 10 seconds instead of timeout (10 minutes)
query-alarms doesn't have such issue because its doesn't generate a temp table
Changed in ceilometer: | |
assignee: | nobody → ZhiQiang Fan (aji-zqfan) |
Changed in ceilometer: | |
status: | Fix Committed → Fix Released |
Changed in ceilometer: | |
milestone: | none → mitaka-1 |
Fix proposed to branch: master /review. openstack. org/235826
Review: https:/