cinder/releasenotes/notes/remove_export_failure_leaves_attachment-24e0c648269b0177.yaml
Gorka Eguileor 3aa00b0878 Delete attachment on remove_export failure
When deleting an attachment, if the driver's remove_export or the
detach_volume method call fails in the cinder driver, then the
attachment status is changed to error_detaching but the REST API call
doesn't fail.

The end result is:
- Volume status is "available"
- Volume attach_status is "detached"
- There is a volume_attachment record for the volume
- The volume may still be exported in the backend

The volume still being exported in the storage array is not a problem,
since the next attach-detach cycle will give it another opportunity for
it to succeed, and we also do the export on volume deletion.

So in the end leaving the attachment in error_detaching status doesn't
have any use and creates confusion.

This patch removes the attachment record when on an attachment delete
request if the error happens on remove_export or detach_volume calls.

This doesn't change how the REST API attachment delete operation
behaves, the change is that there will not be a leftover attachment
record with the volume in available and detached status.

Closes-Bug: #1935057
Change-Id: I442a42b0c098775935a799876ad8efbe141829ad
2021-09-15 16:55:50 +02:00

7 lines
207 B
YAML

---
fixes:
- |
`Bug #1935057 <https://bugs.launchpad.net/cinder/+bug/1935057>`_: Fixed
sometimes on a detach volume may end in available and detached yet have an
attachment in error_detaching.