← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1180040] Re: Race condition in attaching/detaching volumes when compute manager is unreachable

 

** Changed in: nova
       Status: In Progress => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1180040

Title:
  Race condition in attaching/detaching volumes when compute manager is
  unreachable

Status in OpenStack Compute (Nova):
  Invalid

Bug description:
  When a compute manager is offline, or if it cannot pick up messages
  for some reason, a race condition exists in attaching/detaching
  volumes.

  Try attach and detach a volume and then bring the compute manager
  online. Then the reserve_block_device_name message gets delivered and
  a block_device_mapping is created for this instance/volume regardless
  of the state of the volume. This will result in the following issues.

  1. The mountpoint is no longer be usable.
  2. os-volume_attachments API will list the volume as attached to the instance.

  
  Steps to reproduce (This was recreated in Devstack with nova trunk 75af47a.)

  1. Spawn an instance (Mine is a multinode devstack setup, so I spawn it to a different machine than the api, but the race condition should be reproducible in a single-node setup too)
  2. Create a volume
  3. Stop the compute manager (n-cpu)
  4. Try to attach the volume to the instance, it should fail after a while
  5. Try to detach the volume
  6. List the volumes. The volume should be in 'available' state. Optionally you can delete it at this point
  7. Check db for block_device_mapping. It shouldn't have any reference to this volume
  8. Start compute manager on the node that the instance is running
  9. Check db for block_device_mapping and it should now have a new entry associating this volume and instance regardless of the state of the volume

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1180040/+subscriptions