The associated share will be deleted after delete all share replica

Bug #1715783 reported by zhongjun
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Won't Fix
Wishlist
Unassigned

Bug Description

manila create NFS 1 --name zhongjun_test_replica --share-type replica-type
+---------------------------------------+--------------------------------------+
| Property | Value |
+---------------------------------------+--------------------------------------+
| status | creating |
| share_type_name | replica-type |
| description | None |
| availability_zone | None |
| share_network_id | None |
| share_server_id | None |
| share_group_id | None |
| host | |
| revert_to_snapshot_support | False |
| access_rules_status | active |
| snapshot_id | None |
| create_share_from_snapshot_support | False |
| is_public | False |
| task_state | None |
| snapshot_support | False |
| id | 3e0eca4f-704f-4ca7-90e8-856bf789d106 |
| size | 1 |
| source_share_group_snapshot_member_id | None |
| user_id | b7f2c522a5644a83b78b3f61f50c6d71 |
| name | zhongjun_test_replica |
| share_type | 3f6130d5-efdf-485c-8490-fc2bea541d55 |
| has_replicas | False |
| replication_type | readable |
| created_at | 2017-09-07T19:54:31.000000 |
| share_proto | NFS |
| mount_snapshot_support | False |
| project_id | 87ba30b5315c40ec8ec5e3346112eae4 |
| metadata | {} |
+---------------------------------------+--------------------------------------+

root@ubuntu:/opt/stack/manila# manila show 3e0eca4f-704f-4ca7-90e8-856bf789d106
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------+
| Property | Value |
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------+
| status | available |
| share_type_name | replica-type |
| description | None |
| availability_zone | nova |
| share_network_id | None |
| export_locations | |
| | path = 10.0.0.10:/path/to/fake/share/share_3e0eca4f_704f_4ca7_90e8_856bf789d106_d1e56c3d_3747_4f0e_8cbe_fdb2486bd1d2 |
| | preferred = True |
| | is_admin_only = False |
| | id = a67b810b-e82c-4ed2-9b5e-4a59874062a5 |
| | share_instance_id = d1e56c3d-3747-4f0e-8cbe-fdb2486bd1d2 |
| | path = 10.0.0.20:/path/to/fake/share/share_3e0eca4f_704f_4ca7_90e8_856bf789d106_d1e56c3d_3747_4f0e_8cbe_fdb2486bd1d2 |
| | preferred = False |
| | is_admin_only = False |
| | id = cd6b9457-665d-478e-8af5-569000428e1a |
| | share_instance_id = d1e56c3d-3747-4f0e-8cbe-fdb2486bd1d2 |
| | path = 11.0.0.11:/path/to/fake/share/share_3e0eca4f_704f_4ca7_90e8_856bf789d106_d1e56c3d_3747_4f0e_8cbe_fdb2486bd1d2 |
| | preferred = False |
| | is_admin_only = True |
| | id = 95ae403d-65e3-4857-b65e-40f5f7ba7850 |
| | share_instance_id = d1e56c3d-3747-4f0e-8cbe-fdb2486bd1d2 |
| share_server_id | None |
| share_group_id | None |
| host | ubuntu@generic2#fake_pool_for_DummyDriver |
| revert_to_snapshot_support | False |
| access_rules_status | active |
| snapshot_id | None |
| create_share_from_snapshot_support | False |
| is_public | False |
| task_state | None |
| snapshot_support | False |
| id | 3e0eca4f-704f-4ca7-90e8-856bf789d106 |
| size | 1 |
| source_share_group_snapshot_member_id | None |
| user_id | b7f2c522a5644a83b78b3f61f50c6d71 |
| name | zhongjun_test_replica |
| share_type | 3f6130d5-efdf-485c-8490-fc2bea541d55 |
| has_replicas | False |
| replication_type | readable |
| created_at | 2017-09-07T19:54:31.000000 |
| share_proto | NFS |
| mount_snapshot_support | False |
| project_id | 87ba30b5315c40ec8ec5e3346112eae4 |
| metadata | {} |
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------+

root@ubuntu:/opt/stack/manila# manila share-replica-create 3e0eca4f-704f-4ca7-90e8-856bf789d106
+------------------------+--------------------------------------+
| Property | Value |
+------------------------+--------------------------------------+
| status | creating |
| share_id | 3e0eca4f-704f-4ca7-90e8-856bf789d106 |
| availability_zone | None |
| created_at | 2017-09-07T19:55:55.216613 |
| updated_at | None |
| share_network_id | None |
| id | e6bed130-95b8-4cfc-a6bc-ae4c9d6445ed |
| share_server_id | None |
| host | |
| replica_state | None |
| cast_rules_to_readonly | True |
+------------------------+--------------------------------------+

root@ubuntu:/opt/stack/manila# manila share-replica-list --share-id 3e0eca4f-704f-4ca7-90e8-856bf789d106
+--------------------------------------+-----------+---------------+--------------------------------------+-------------------------------------------+-------------------+----------------------------+
| ID | Status | Replica State | Share ID | Host | Availability Zone | Updated At |
+--------------------------------------+-----------+---------------+--------------------------------------+-------------------------------------------+-------------------+----------------------------+
| d1e56c3d-3747-4f0e-8cbe-fdb2486bd1d2 | available | active | 3e0eca4f-704f-4ca7-90e8-856bf789d106 | ubuntu@generic2#fake_pool_for_DummyDriver | nova | 2017-09-07T19:54:36.000000 |
| e6bed130-95b8-4cfc-a6bc-ae4c9d6445ed | error | error | 3e0eca4f-704f-4ca7-90e8-856bf789d106 | | None | 2017-09-07T19:55:56.000000 |
+--------------------------------------+-----------+---------------+--------------------------------------+-------------------------------------------+-------------------+----------------------------+

root@ubuntu:/opt/stack/manila# manila share-replica-delete e6bed130-95b8-4cfc-a6bc-ae4c9d6445ed
root@ubuntu:/opt/stack/manila# manila share-replica-list --share-id 3e0eca4f-704f-4ca7-90e8-856bf789d106
+--------------------------------------+-----------+---------------+--------------------------------------+-------------------------------------------+-------------------+----------------------------+
| ID | Status | Replica State | Share ID | Host | Availability Zone | Updated At |
+--------------------------------------+-----------+---------------+--------------------------------------+-------------------------------------------+-------------------+----------------------------+
| d1e56c3d-3747-4f0e-8cbe-fdb2486bd1d2 | available | active | 3e0eca4f-704f-4ca7-90e8-856bf789d106 | ubuntu@generic2#fake_pool_for_DummyDriver | nova | 2017-09-07T19:54:36.000000 |
+--------------------------------------+-----------+---------------+--------------------------------------+-------------------------------------------+-------------------+----------------------------+
root@ubuntu:/opt/stack/manila# manila share-replica-reset-replica-state d1e56c3d-3747-4f0e-8cbe-fdb2486bd1d2
root@ubuntu:/opt/stack/manila# manila share-replica-list --share-id 3e0eca4f-704f-4ca7-90e8-856bf789d106
+--------------------------------------+-----------+---------------+--------------------------------------+-------------------------------------------+-------------------+----------------------------+
| ID | Status | Replica State | Share ID | Host | Availability Zone | Updated At |
+--------------------------------------+-----------+---------------+--------------------------------------+-------------------------------------------+-------------------+----------------------------+
| d1e56c3d-3747-4f0e-8cbe-fdb2486bd1d2 | available | out_of_sync | 3e0eca4f-704f-4ca7-90e8-856bf789d106 | ubuntu@generic2#fake_pool_for_DummyDriver | nova | 2017-09-07T19:58:35.000000 |
+--------------------------------------+-----------+---------------+--------------------------------------+-------------------------------------------+-------------------+----------------------------+
root@ubuntu:/opt/stack/manila# manila show 3e0eca4f-704f-4ca7-90e8-856bf789d106
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------+
| Property | Value |
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------+
| status | available |
| share_type_name | replica-type |
| description | None |
| availability_zone | nova |
| share_network_id | None |
| export_locations | |
| | path = 10.0.0.10:/path/to/fake/share/share_3e0eca4f_704f_4ca7_90e8_856bf789d106_d1e56c3d_3747_4f0e_8cbe_fdb2486bd1d2 |
| | preferred = True |
| | is_admin_only = False |
| | id = a67b810b-e82c-4ed2-9b5e-4a59874062a5 |
| | share_instance_id = d1e56c3d-3747-4f0e-8cbe-fdb2486bd1d2 |
| | path = 10.0.0.20:/path/to/fake/share/share_3e0eca4f_704f_4ca7_90e8_856bf789d106_d1e56c3d_3747_4f0e_8cbe_fdb2486bd1d2 |
| | preferred = False |
| | is_admin_only = False |
| | id = cd6b9457-665d-478e-8af5-569000428e1a |
| | share_instance_id = d1e56c3d-3747-4f0e-8cbe-fdb2486bd1d2 |
| | path = 11.0.0.11:/path/to/fake/share/share_3e0eca4f_704f_4ca7_90e8_856bf789d106_d1e56c3d_3747_4f0e_8cbe_fdb2486bd1d2 |
| | preferred = False |
| | is_admin_only = True |
| | id = 95ae403d-65e3-4857-b65e-40f5f7ba7850 |
| | share_instance_id = d1e56c3d-3747-4f0e-8cbe-fdb2486bd1d2 |
| share_server_id | None |
| share_group_id | None |
| host | ubuntu@generic2#fake_pool_for_DummyDriver |
| revert_to_snapshot_support | False |
| access_rules_status | active |
| snapshot_id | None |
| create_share_from_snapshot_support | False |
| is_public | False |
| task_state | None |
| snapshot_support | False |
| id | 3e0eca4f-704f-4ca7-90e8-856bf789d106 |
| size | 1 |
| source_share_group_snapshot_member_id | None |
| user_id | b7f2c522a5644a83b78b3f61f50c6d71 |
| name | zhongjun_test_replica |
| share_type | 3f6130d5-efdf-485c-8490-fc2bea541d55 |
| has_replicas | False |
| replication_type | readable |
| created_at | 2017-09-07T19:54:31.000000 |
| share_proto | NFS |
| mount_snapshot_support | False |
| project_id | 87ba30b5315c40ec8ec5e3346112eae4 |
| metadata | {} |
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------+
root@ubuntu:/opt/stack/manila# manila share-replica-list --share-id 3e0eca4f-704f-4ca7-90e8-856bf789d106
+--------------------------------------+-----------+---------------+--------------------------------------+-------------------------------------------+-------------------+----------------------------+
| ID | Status | Replica State | Share ID | Host | Availability Zone | Updated At |
+--------------------------------------+-----------+---------------+--------------------------------------+-------------------------------------------+-------------------+----------------------------+
| d1e56c3d-3747-4f0e-8cbe-fdb2486bd1d2 | available | out_of_sync | 3e0eca4f-704f-4ca7-90e8-856bf789d106 | ubuntu@generic2#fake_pool_for_DummyDriver | nova | 2017-09-07T19:58:35.000000 |
+--------------------------------------+-----------+---------------+--------------------------------------+-------------------------------------------+-------------------+----------------------------+
root@ubuntu:/opt/stack/manila# manila share-replica-delete d1e56c3d-3747-4f0e-8cbe-fdb2486bd1d2
root@ubuntu:/opt/stack/manila# manila share-replica-list --share-id 3e0eca4f-704f-4ca7-90e8-856bf789d106
ERROR: 'NoneType' object has no attribute 'pop'
root@ubuntu:/opt/stack/manila# manila share-replica-list
+--------------------------------------+--------------------+---------------+--------------------------------------+-------------------------------------------+-------------------+----------------------------+
| ID | Status | Replica State | Share ID | Host | Availability Zone | Updated At |
+--------------------------------------+--------------------+---------------+--------------------------------------+-------------------------------------------+-------------------+----------------------------+
| 18600f5f-f0b8-418f-9ca9-295100c877c6 | available | active | 729da773-d042-4c59-a434-a9f0eddf317b | ubuntu@generic2#fake_pool_for_DummyDriver | nova | 2017-09-05T00:40:36.000000 |
| 3edb4db9-120e-4195-993b-e3f9680533da | replication_change | out_of_sync | 6ea80290-a081-42c7-b2a2-3d41ecee85c8 | | None | 2017-09-05T01:08:45.000000 |
| 61408eb9-c25d-46a7-86fc-ff4a9d6daedf | available | active | 6ea80290-a081-42c7-b2a2-3d41ecee85c8 | ubuntu@generic2#fake_pool_for_DummyDriver | nova | 2017-09-05T00:50:25.000000 |
| 79b6b406-f72f-438f-b388-42682e2f4c1c | available | active | 09a969a3-0ad4-4d85-8f81-bc2f7f0fcfa8 | ubuntu@generic2#fake_pool_for_DummyDriver | nova | 2017-09-05T00:47:58.000000 |
| a5a0dbd9-563c-489c-ac2f-95d045f62435 | available | active | 56e0950c-0897-4099-8b8a-ddad21c6d5fb | ubuntu@generic2#fake_pool_for_DummyDriver | nova | 2017-09-05T01:33:39.000000 |
| b8419a17-ee89-42f7-9825-0a028c9d2cd0 | available | active | beb8c121-cf16-4be9-a016-80c24728e3a7 | ubuntu@generic2#fake_pool_for_DummyDriver | nova | 2017-09-06T01:58:15.000000 |
| b97801f1-2f50-4516-9963-4ebe864f73d9 | error | error | 6ea80290-a081-42c7-b2a2-3d41ecee85c8 | | None | 2017-09-05T00:50:38.000000 |
| c0992f66-1fd7-40b8-9744-de381ed44915 | error | error | 6ea80290-a081-42c7-b2a2-3d41ecee85c8 | | None | 2017-09-05T01:04:57.000000 |
+--------------------------------------+--------------------+---------------+--------------------------------------+-------------------------------------------+-------------------+----------------------------+
root@ubuntu:/opt/stack/manila# manila list
+--------------------------------------+----------------+------+-------------+--------------------+-----------+-----------------+-------------------------------------------+-------------------+
| ID | Name | Size | Share Proto | Status | Is Public | Share Type Name | Host | Availability Zone |
+--------------------------------------+----------------+------+-------------+--------------------+-----------+-----------------+-------------------------------------------+-------------------+
| 09a969a3-0ad4-4d85-8f81-bc2f7f0fcfa8 | replica_test_2 | 1 | NFS | available | False | replica-type | ubuntu@generic2#fake_pool_for_DummyDriver | nova |

zhongjun (jun-zhongjun)
description: updated
description: updated
description: updated
zhongjun (jun-zhongjun)
summary: - Share replica problem
+ Check Share replica problem
zhongjun (jun-zhongjun)
summary: - Check Share replica problem
+ The associated share will be deleted after delete share replica
summary: - The associated share will be deleted after delete share replica
+ The associated share will be deleted after delete all share replica
Revision history for this message
Goutham Pacha Ravi (gouthamr) wrote :

Hi Zhongjun,

The UX/Workflow of share replication is like this:

* Create a share (with a share type that specifies one of three replication types supported)

Notice that the CLI ``manila share-replica-list --share-id SHARE_ID`` will return a "replica". This is the share itself, it is not a secondary mirror of the share.

You can use ``manila show SHARE_ID`` to verify that the share indeed has no secondary mirrors yet. See field "has_replicas".

* Create one or more replicas with CLI ``manila share-replica-create SHARE_ID <REPLICA_AZ>``
* Try to delete the share with CLI ``manila delete SHARE_ID``
You can't delete the share because you have secondary replicas associated with the share

So, how do you delete the share?
* Use ``manila share-replica-delete <replica_id_1>, <replica_id_2>,...``
On all the secondary (non-active) replicas.. in case of "writable" replication, you can delete all the other active replicas as well, except the primary one.
* You cannot use ``manila share-replica-delete`` to delete the primary share, you should use ``manila delete`` to delete the share.

``manila reset-replica-state`` is only meant for administrators to change the "replica-state" of the replica directly on the database. This is an option administrators can use to recover from failures when they have corrected something with the replica out-of-band of manila. When you use this on the last replica (the primary) of a share, you confuse and break Manila's API.

Changed in manila:
status: New → Invalid
status: Invalid → Won't Fix
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.