Delete volume transfer while doing volume force delete operation

Bug #1270785 reported by ling-yun on 2014-01-20
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Undecided
ling-yun
Havana
Undecided
ling-yun

Bug Description

Doing volume force delete operation on volume-A will change volume-A's status to 'deleted', so all related data about volume-A should be deleted. Now current version's volume_destroy function doesn't delete related data of volume transfer. If there is volume transfer about volume-A, first do force delete operation on volume A, and thus the volume-A's transfer data would be residual. So remove the related data of volume transfer in volume_destroy function.

ling-yun (zengyunling) wrote :
Download full text (3.3 KiB)

Volume transfer record residual when doing volume force delete, because there is no way to delete volume transfer through transfer api.

1. Create a volume
root@devstack:/dev/stack-volumes# cinder create 1
+--------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| created_at | 2014-01-20T10:19:31.000000 |
| description | None |
| id | 116be7cb-0213-4efc-b9d5-881091d3e224 |
| metadata | {} |
| name | None |
| os-vol-host-attr:host | None |
| os-vol-mig-status-attr:migstat | None |
| os-vol-mig-status-attr:name_id | None |
| os-vol-tenant-attr:tenant_id | b758d3cb3e944d3c824a43c1f6165684 |
| size | 1 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| user_id | 21e2bffb18fe48869de3a37df3c443c2 |
| volume_type | None |
+--------------------------------+--------------------------------------+

2. Create a volume transfer
root@devstack:/dev/stack-volumes# cinder transfer-create 116be7cb-0213-4efc-b9d5-881091d3e224
+------------+--------------------------------------+
| Property | Value |
+------------+--------------------------------------+
| auth_key | 071989743f0721df |
| created_at | 2014-01-20T10:19:43.538202 |
| id | 9c341c53-30f2-4f3d-a3e6-d9f2299a3b23 |
| name | None |
| volume_id | 116be7cb-0213-4efc-b9d5-881091d3e224 |
+------------+--------------------------------------+

3. Force delete a volume
root@devstack:/dev/stack-volumes# cinder force-delete 116be7cb-0213-4efc-b9d5-881091d3e224

mysql> select id, status from volumes where volumes.id='116be7cb-0213-4efc-b9d5-881091d3e224';
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 1339
Current database: cinder

+--------------------------------------+---------+
| id | status |
+--------------------------------------+---------+
| 116be7cb-0213-4efc-b9d5-881091d3e224 | deleted |
+--------------------------------------+---------+
1 row in set (0.08 sec)

4. Delete a volume transfer, error happpened
root@devstack:/dev/stack-volumes# cinder transfer-delete 9c341c53-30f2-4f3d-a3e6-d9f...

Read more...

Changed in cinder:
assignee: nobody → ling-yun (zengyunling)

Fix proposed to branch: master
Review: https://review.openstack.org/67814

Changed in cinder:
status: New → In Progress

Reviewed: https://review.openstack.org/67814
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=19d8040d61d453ec3916d74c628189ca0b54ac59
Submitter: Jenkins
Branch: master

commit 19d8040d61d453ec3916d74c628189ca0b54ac59
Author: ling-yun <email address hidden>
Date: Mon Jan 20 18:48:43 2014 +0800

    Delete volume transfer in volume_destroy function

    Doing volume force delete operation on volume-A will change volume-A's
    status to 'deleted', so all related data about volume-A should be deleted.
    Now current version's volume_destroy function doesn't delete related data
    of volume transfer. If there is volume transfer about volume-A, first do
    force delete operation on volume A, and thus the volume-A's transfer data
    would be residual. So remove the related data of volume transfer in
    volume_destroy function.

    Change-Id: Id80a6e0cc061fccb02af60706244be043abdd72d
    Closes-Bug: #1270785

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2014-03-05
Changed in cinder:
milestone: none → icehouse-3
status: Fix Committed → Fix Released

Reviewed: https://review.openstack.org/72249
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=42e28055aaf3868cc8bd2730e0840e872012abc0
Submitter: Jenkins
Branch: stable/havana

commit 42e28055aaf3868cc8bd2730e0840e872012abc0
Author: ling-yun <email address hidden>
Date: Mon Jan 20 18:48:43 2014 +0800

    Delete volume transfer in volume_destroy function

    Doing volume force delete operation on volume-A will change volume-A's
    status to 'deleted', so all related data about volume-A should be deleted.
    Now current version's volume_destroy function doesn't delete related data
    of volume transfer. If there is volume transfer about volume-A, first do
    force delete operation on volume A, and thus the volume-A's transfer data
    would be residual. So remove the related data of volume transfer in
    volume_destroy function.

    Change-Id: Id80a6e0cc061fccb02af60706244be043abdd72d
    Closes-Bug: #1270785
    (cherry picked from commit 19d8040d61d453ec3916d74c628189ca0b54ac59)

tags: added: in-stable-havana
Thierry Carrez (ttx) on 2014-04-17
Changed in cinder:
milestone: icehouse-3 → 2014.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers