Race between cinder and nova allows multiple detaches
Bug #1238093 reported by
Duncan Thomas
This bug affects 5 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Fix Released
|
High
|
Gorka Eguileor |
Bug Description
There's a race during detach which can cause a volume to be left in an invalid status if multiple detaches are issued on the same volume.
A diagram of the race can be found at http://
The fix I think is that begin_detaching needs to atomically check that the status is [in-use|detaching] and set it to detaching. Then detach() needs to atomically check for detaching and set to in-use, both cases returning exceptions as relevant.
description: | updated |
description: | updated |
Changed in cinder: | |
assignee: | nobody → Lee Li (lilinguo) |
Changed in cinder: | |
assignee: | Lee Li (lilinguo) → nobody |
Changed in cinder: | |
assignee: | nobody → Ryan McNair (rdmcnair) |
Changed in cinder: | |
assignee: | Ryan McNair (rdmcnair) → Gorka Eguileor (gorka) |
To post a comment you must log in.
I think this is a specific case of a more general problem - that's what happens when check-and-set isn't atomic. I thought about this a little while back but unfortunately got sidetracked and didn't follow up. This could either be done at the DB level or by grabbing a lock.