Unable to sort data with MongoDB

Bug #1193906 reported by Julien Danjou
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Critical
Terri Yu
Grizzly
Fix Released
Critical
Eoghan Glynn

Bug Description

The follwing happens in get_samples() from impl_mongodb:

OperationFailure: database error: too much data for sort() with no index. add an index or specify a smaller limit

Now that everything is sort()'ed, without an index, MongoDB fails to sort. We need a descending index on timestamp.

Julien Danjou (jdanjou)
Changed in ceilometer:
assignee: nobody → Terri Yu (terriyu)
importance: Undecided → Critical
milestone: none → havana-2
status: New → Confirmed
Julien Danjou (jdanjou)
Changed in ceilometer:
status: Confirmed → In Progress
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/36159

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/36159
Committed: http://github.com/openstack/ceilometer/commit/e984f28b00e3a073c176f6435507f5bce1c82d30
Submitter: Jenkins
Branch: master

commit e984f28b00e3a073c176f6435507f5bce1c82d30
Author: vagrant <vagrant@precise64.(none)>
Date: Tue Jul 9 02:29:36 2013 +0000

    Add index for db.meter by descending timestamp

    Fixes bug #1193906

    Added an index for db.meter to sort by descending time stamp for class
    Connection in ceilometer/storage/impl_mongodb.py

    ensure_index() is used rather than create_index() to be more efficient.

    This index is needed because get_samples() in
    ceilometer/storage/impl_mongodb.py sorts by descending timestamp. Without an
    index, MongoDB will fail to sort if the database is too large.

    Change-Id: I23070f153ce03a8d6d8c9f17f05e2d5dae38647e

Changed in ceilometer:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (stable/grizzly)

Fix proposed to branch: stable/grizzly
Review: https://review.openstack.org/39463

Eoghan Glynn (eglynn)
tags: added: grizzly-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (stable/grizzly)

Reviewed: https://review.openstack.org/39463
Committed: http://github.com/openstack/ceilometer/commit/8ddafe40532619bbb3c4055be3f74471f0dcc518
Submitter: Jenkins
Branch: stable/grizzly

commit 8ddafe40532619bbb3c4055be3f74471f0dcc518
Author: terriyu <email address hidden>
Date: Tue Jul 9 02:29:36 2013 +0000

    Add index for db.meter by descending timestamp

    Fixes bug #1193906

    Added an index for db.meter to sort by descending time stamp for class
    Connection in ceilometer/storage/impl_mongodb.py

    ensure_index() is used rather than create_index() to be more efficient.

    This index is needed because get_samples() in
    ceilometer/storage/impl_mongodb.py sorts by descending timestamp. Without an
    index, MongoDB will fail to sort if the database is too large.

    Change-Id: I23070f153ce03a8d6d8c9f17f05e2d5dae38647e
    (cherry picked from commit e984f28b00e3a073c176f6435507f5bce1c82d30)

tags: added: in-stable-grizzly
Alan Pevec (apevec)
tags: removed: grizzly-backport-potential in-stable-grizzly
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: havana-2 → 2013.2
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.