resource-list seems not work with postgresql

Bug #1241526 reported by Mehdi Abaakouk
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
High
Thomas Maddox
Havana
Won't Fix
Undecided
Unassigned

Bug Description

Julien Danjou (jdanjou)
Changed in ceilometer:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Thomas Maddox (thomas-maddox) wrote :

Looks to be because of three non-aggregate values being selected from an aggregated subquery:

(SELECT
        max(meter.id) AS max_id,
        anon_2.resource_id AS resource_id,
        anon_2.max_ts AS max_ts,
        anon_2.min_ts AS min_ts
    FROM meter,
        (SELECT
            meter.resource_id AS resource_id,
            max(meter.timestamp) AS max_ts,
            min(meter.timestamp) AS min_ts
        FROM meter
        GROUP BY meter.resource_id) AS anon_2
    WHERE
        meter.resource_id = anon_2.resource_id AND
        meter.timestamp = anon_2.max_ts
    GROUP BY meter.resource_id)

The logs were complaining about anon_2.resource_id; I'd wager the other 2 will cause trouble as well.

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/52966

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

Reviewed: https://review.openstack.org/52966
Committed: http://github.com/openstack/ceilometer/commit/0a98159bc9c727a89bd8c15347ac380a21acaa59
Submitter: Jenkins
Branch: master

commit 0a98159bc9c727a89bd8c15347ac380a21acaa59
Author: Thomas Maddox <email address hidden>
Date: Mon Oct 21 15:55:49 2013 +0000

    Fix for get_resources with postgresql

    Add max_ts and min_ts to GROUP BY in sub-query, since they need to be aggregated to SELECT them.

    Closes-Bug: #1241526
    Change-Id: Ifdd2bc661b5da31bd40d1c3fa1fc442d7417399f

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