instance-action-list events are not ordered by time

Bug #1254764 reported by Qiu Yu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Qiu Yu

Bug Description

By design, "events" in nova instance-action-list result should be listed in in chronological order. However, often can be seen "compute_run_instance" event happens before "schedule" event.

For example:

+---------------+--------------------------------------------------+
| Property | Value |
+---------------+--------------------------------------------------+
| instance_uuid | 461e1aae-6eae-4172-b2fe-2984dab34a1f |
| user_id | 30d8f5a8deaf446ba51131b751ab8b46 |
| start_time | 2013-11-25T14:26:18.000000 |
| request_id | req-18c907ac-dbd7-4898-a6ed-e5dbb5c8da91 |
| action | create |
| message | None |
| project_id | 5bd1b3ec18b84b8ea3403bdc662983fb |
| events | [{u'event': u'schedule', |
| | u'finish_time': None, |
| | u'result': None, |
| | u'start_time': u'2013-11-25T14:26:49.000000', |
| | u'traceback': None}, |
| | {u'event': u'schedule', |
| | u'finish_time': None, |
| | u'result': None, |
| | u'start_time': u'2013-11-25T14:26:46.000000', |
| | u'traceback': None}, |
| | {u'event': u'compute_run_instance', |
| | u'finish_time': None, |
| | u'result': None, |
| | u'start_time': u'2013-11-25T14:26:46.000000', |
| | u'traceback': None}, |
| | {u'event': u'schedule', |
| | u'finish_time': u'2013-11-25T14:26:49.000000', |
| | u'result': u'Success', |
| | u'start_time': u'2013-11-25T14:26:19.000000', |
| | u'traceback': None}, |
| | {u'event': u'compute_run_instance', |
| | u'finish_time': u'2013-11-25T14:26:47.000000', |
| | u'result': u'Success', |
| | u'start_time': u'2013-11-25T14:27:35.000000', |
| | u'traceback': None}] |
+---------------+--------------------------------------------------+

should be:

+---------------+--------------------------------------------------+
| Property | Value |
+---------------+--------------------------------------------------+
| instance_uuid | 461e1aae-6eae-4172-b2fe-2984dab34a1f |
| user_id | 30d8f5a8deaf446ba51131b751ab8b46 |
| start_time | 2013-11-25T14:26:18.000000 |
| request_id | req-18c907ac-dbd7-4898-a6ed-e5dbb5c8da91 |
| action | create |
| message | None |
| project_id | 5bd1b3ec18b84b8ea3403bdc662983fb |
| events | [{u'event': u'schedule', |
| | u'finish_time': None, |
| | u'result': None, |
| | u'start_time': u'2013-11-25T14:26:49.000000', |
| | u'traceback': None}, |
| | {u'event': u'compute_run_instance', |
| | u'finish_time': None, |
| | u'result': None, |
| | u'start_time': u'2013-11-25T14:26:46.000000', |
| | u'traceback': None}, |
| | {u'event': u'schedule', |
| | u'finish_time': None, |
| | u'result': None, |
| | u'start_time': u'2013-11-25T14:26:46.000000', |
| | u'traceback': None}, |
| | {u'event': u'compute_run_instance', |
| | u'finish_time': u'2013-11-25T14:26:47.000000', |
| | u'result': u'Success', |
| | u'start_time': u'2013-11-25T14:27:35.000000', |
| | u'traceback': None}, |
| | {u'event': u'schedule', |
| | u'finish_time': u'2013-11-25T14:26:49.000000', |
| | u'result': u'Success', |
| | u'start_time': u'2013-11-25T14:26:19.000000', |
| | u'traceback': None}] |
+---------------+--------------------------------------------------+

Qiu Yu (unicell)
Changed in nova:
assignee: nobody → Qiu Yu (unicell)
Andrew Laski (alaski)
Changed in nova:
importance: Undecided → Low
status: New → In Progress
Revision history for this message
Qiu Yu (unicell) wrote :

Don't know why the gerrit link doesn't show up here. Updating manually.

Fix proposed to branch: master
Review: https://review.openstack.org/58319

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

Reviewed: https://review.openstack.org/58319
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=1eab1e9aefe6da83204b3705b01433add113ec06
Submitter: Jenkins
Branch: master

commit 1eab1e9aefe6da83204b3705b01433add113ec06
Author: Qiu Yu <email address hidden>
Date: Mon Nov 25 20:28:39 2013 +0800

    Ensure instance action event list in order

    For two events also most happening at the same time, e.g. schedule and
    run_instance, instance-action may fail to do the correct sorting because
    the "create_at" column in db has the same value.

    This change fixes this issue by sorting in "create_at" first, and then
    in database generated "id" column, both in descending order.

    Closes-bug: 1254764

    Change-Id: I245a577ef2821fa7f3316bb8a21b7e6370498dd0

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