Unexpected Task State Error on Snapshot

Bug #1065250 reported by Rick Harris
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Rick Harris

Bug Description

The following error can be observed when running Nova in a multi-cell environment:

http://paste.openstack.org/show/21595/

The key problem is that the task_state is being updated as 'image_snapshot' in the API db but that task-state isn't getting propagated down to the cell DB.

The reason it's not being propagated down is because instance_test_and_set fetches a *new* instance object and sets the task_state on *that*; however we pass a different instance, with the original task-state to the compute.rpcai.snapshot call.

The solution is to mirror what we do with instance_update and have instance_test_and_set return an instance_ref which we use from then on, e.g.

instance = foo
instance = instance_test_and_set(instance.uuid, 'something')
print instance # this is the new instance that has the task-state set appropriately

Changed in nova:
assignee: nobody → Rick Harris (rconradharris)
importance: Undecided → High
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

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

Reviewed: https://review.openstack.org/14313
Committed: http://github.com/openstack/nova/commit/3e6829a2012dd557a9e7c64281d4e6c73d1e3632
Submitter: Jenkins
Branch: master

commit 3e6829a2012dd557a9e7c64281d4e6c73d1e3632
Author: Rick Harris <email address hidden>
Date: Wed Oct 10 21:36:24 2012 +0000

    Pass correct task_state on snapshot

    This fixes an issue where we were not passing the correct task_state to
    the compute manager thereby triggering an 'unexpected task-state error'
    when the snapshot finished.

    This error only manifested itself in multi-cell setups where the
    compute-manager and compute-api are using separate DB's and therefore
    must rely on the RPC-layer to enforce consistency.

    Fixes bug 1065250

    Change-Id: Ie07454f0d2075f5c3f2dd53b4e5ff9983ea3241f

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