V3 attachment_update sets volume to "in-use", should be "attaching"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Fix Released
|
Critical
|
John Griffith |
Bug Description
The new attachment_update method in Cinder's API creates an attachment object and populates it with the provided connector info. In addition, we set the volumes status to in-use and update the attachment object status to "attached".
This isn't really accurate though, because we don't know if the volume is actually attached (connected) by the consumer or not. We make that assumption which might be ok, particular for consumers outside of OpenStack that keep their own records of things.
In a traditional nova/openstack context however this creates some significant problems. Primarily the standard for testing and knowing if a volume is in-use or not is the volume-status flag and it indicates that the volume has been acknowledged as succesfully connected/attached to an Instance. By setting this to in-use on the attachment_update call we introduce a pretty bad race:
1. attachment_update
- volume status goes to in-use
- nova issues call to os-brick to perform connection and attach to instance
2. Tempest test is polling looking for volume-status "in-use" to determine if/when done
- Tempest sees the "in-use" status, considers the process complete, test good and issues
a detach
It turns out that the detach can easily end up being called while brick is still working on
connecting the volume. When this happens, we then try and do a disconnect, brick doesn't see
the device and moves along. But then we end up with an orphaned device file on the compute node.
Another big draw back here in terms of the tests is that it's possible for every single brick connection to fail, but for all of the tests to be marked as "passed". This is a pretty serious bug.
Changed in cinder: | |
status: | New → In Progress |
importance: | Undecided → Critical |
assignee: | nobody → John Griffith (john-griffith) |
Fix proposed to branch: master /review. openstack. org/493262
Review: https:/