[taskflow] Incorrect state transition on failure of create volume API
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Fix Released
|
High
|
Joshua Harlow |
Bug Description
Commit: 1874d913ecbf8f0
State transition of the volume state on failure during VolumeCastTask is not done correctly.
Given the below sequence of task during Create Volume api:
1) (InjectTask) Create request data for rest of the tasks.
2) (ExtractVolumeR
3) (QuotaReserveTask) Reserve the quota for this request.
4) (EntryCreateTask) Create database entry for the volume(s). On revert, sets the volume state to "deleted"
5) (QuotaCommitTask) Commit the reserved quota for this request.
6) (OnFailureChang
7) (VolumeCastTask) Casts to Scheduler - A Failure occurs during this task before rpc to c-scheduler is made
If failure occurs during the task "VolumeCastTask", then the revert action of the previous task "OnFailureChang
The state of error should remain until the user requests the volume to be marked deleted in this case.
Changed in cinder: | |
assignee: | nobody → Abhijeet Malawade (abhijeet-malawade) |
Changed in cinder: | |
importance: | Undecided → High |
milestone: | none → havana-rc1 |
Changed in cinder: | |
status: | New → In Progress |
Changed in cinder: | |
assignee: | Abhijeet Malawade (abhijeet-malawade) → Joshua Harlow (harlowja) |
Changed in cinder: | |
status: | Fix Committed → Fix Released |
Changed in cinder: | |
milestone: | havana-rc1 → 2013.2 |
Hi John, I was under the assumption that in case of failure the http response is returned to the user and then these failed tasks are reverted.
But since the http response is returned only after all the reversions are completed, IMO if the volume goes into "error" state, we should destroy the volume and return the appropriate http response (500 or 4xx status code) instead of not destroying the volume and letting the user take action later on.
What do you think about this?