NFS doesn't remove snapshots in error status

Bug #1842088 reported by Sofia Enriquez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Sofia Enriquez

Bug Description

Description of problem:
While testing NFS snapshot support, on one of the cases snapshot support was set to false. As such a snapshot was created in error state due to lack of backend snapshot support - expected.

When I tried to delete that snapshot it failed (even when using the --force option). Because of that, I can't remove source volume due to the snapshot.

How reproducible:
One quick way to reproduce is to set 'nfs_snapshot_support' to False inside the cinder.conf.

Steps to Reproduce:
Inside the cinder.conf: set 'nfs_snapshot_support' to False.
1. cinder create 1 --name v1
2. cinder snapshot-create v1 --name snap1
The snap should be in 'error' status.
3. cinder snapshot-delete snap1

Actual results:
Snapshot status is 'error_deleting'.

Expected results:
Snapshot delete successfully.

Additional info:
I'm facing this problem in Stein too.

Changed in cinder:
assignee: nobody → Sofia Enriquez (lsofia-enriquez)
Changed in cinder:
status: New → In Progress
Revision history for this message
Sofia Enriquez (lsofia-enriquez) wrote :
Revision history for this message
Walt Boring (walter-boring) wrote :

It seems like the real issue here is the create when disabled issue.
Looking at the _check_snapshot_support(), I'm not sure how that doesn't raise
when snaps are disabled.
https://github.com/openstack/cinder/blob/master/cinder/volume/drivers/nfs.py#L549-L555

tags: added: generic-nfs
tags: added: nfs snapshot
removed: generic-nfs
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.opendev.org/c/openstack/cinder/+/679138
Committed: https://opendev.org/openstack/cinder/commit/5714bdb8447a38440585116f784a322143711959
Submitter: "Zuul (22348)"
Branch: master

commit 5714bdb8447a38440585116f784a322143711959
Author: Sofia Enriquez <email address hidden>
Date: Wed Aug 28 17:38:50 2019 -0300

    Allow removing NFS snapshots in error status

    The NFS driver doesn't allow to delete snapshots in error state when
    snapshot support is disable.

    I'm facing some scenarios where snapshots are enabled then a snapshot
    is created and after that then snapshots are disabled. This results
    in error state snapshots that can't be deleted. Another scenario is
    - with nfs snapshot support disable from the beginning- the API layer
    allows the snapshot to be created but the NFS driver sets the status
    to "error" leaving the snapshot in the DB with error state.
    Because of that, I have snapshots in error state that I'm not able
    to delete.

    The purpose of this fix allow deleting snapshots in error state.
    It makes sense to block creating snapshots when snapshot support is
    False. However, when deleting snapshot we don't want to block
    attempts to delete a broken snapshot DB entry, which is necessary to
    clean up a failed snapshot create.

    Closes-Bug: #1842088
    Change-Id: Ieb19d5e3f58ae2343b6b145772fec33cb7517ab5

Changed in cinder:
status: In Progress → Fix Released
Changed in cinder:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/cinder/+/805283

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/cinder/+/805283
Committed: https://opendev.org/openstack/cinder/commit/5a4f3ac53a554ecaa18cbd0a49c0606dff4e1137
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 5a4f3ac53a554ecaa18cbd0a49c0606dff4e1137
Author: Sofia Enriquez <email address hidden>
Date: Wed Aug 28 17:38:50 2019 -0300

    Allow removing NFS snapshots in error status

    The NFS driver doesn't allow to delete snapshots in error state when
    snapshot support is disable.

    I'm facing some scenarios where snapshots are enabled then a snapshot
    is created and after that then snapshots are disabled. This results
    in error state snapshots that can't be deleted. Another scenario is
    - with nfs snapshot support disable from the beginning- the API layer
    allows the snapshot to be created but the NFS driver sets the status
    to "error" leaving the snapshot in the DB with error state.
    Because of that, I have snapshots in error state that I'm not able
    to delete.

    The purpose of this fix allow deleting snapshots in error state.
    It makes sense to block creating snapshots when snapshot support is
    False. However, when deleting snapshot we don't want to block
    attempts to delete a broken snapshot DB entry, which is necessary to
    clean up a failed snapshot create.

    Closes-Bug: #1842088
    Change-Id: Ieb19d5e3f58ae2343b6b145772fec33cb7517ab5
    (cherry picked from commit 5714bdb8447a38440585116f784a322143711959)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/victoria)

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/cinder/+/806696

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 18.1.0

This issue was fixed in the openstack/cinder 18.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/victoria)

Reviewed: https://review.opendev.org/c/openstack/cinder/+/806696
Committed: https://opendev.org/openstack/cinder/commit/fb0efc42149fab524a9d3a95f01b7b71e954f314
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit fb0efc42149fab524a9d3a95f01b7b71e954f314
Author: Sofia Enriquez <email address hidden>
Date: Wed Aug 28 17:38:50 2019 -0300

    Allow removing NFS snapshots in error status

    The NFS driver doesn't allow to delete snapshots in error state when
    snapshot support is disable.

    I'm facing some scenarios where snapshots are enabled then a snapshot
    is created and after that then snapshots are disabled. This results
    in error state snapshots that can't be deleted. Another scenario is
    - with nfs snapshot support disable from the beginning- the API layer
    allows the snapshot to be created but the NFS driver sets the status
    to "error" leaving the snapshot in the DB with error state.
    Because of that, I have snapshots in error state that I'm not able
    to delete.

    The purpose of this fix allow deleting snapshots in error state.
    It makes sense to block creating snapshots when snapshot support is
    False. However, when deleting snapshot we don't want to block
    attempts to delete a broken snapshot DB entry, which is necessary to
    clean up a failed snapshot create.

    Closes-Bug: #1842088
    Change-Id: Ieb19d5e3f58ae2343b6b145772fec33cb7517ab5
    (cherry picked from commit 5714bdb8447a38440585116f784a322143711959)
    (cherry picked from commit 5a4f3ac53a554ecaa18cbd0a49c0606dff4e1137)

tags: added: in-stable-victoria
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 19.0.0.0rc1

This issue was fixed in the openstack/cinder 19.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/cinder/+/809669

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/ussuri)

Reviewed: https://review.opendev.org/c/openstack/cinder/+/809669
Committed: https://opendev.org/openstack/cinder/commit/e9ef536958d9920b70cbbf27bc7faf548ad42d36
Submitter: "Zuul (22348)"
Branch: stable/ussuri

commit e9ef536958d9920b70cbbf27bc7faf548ad42d36
Author: Sofia Enriquez <email address hidden>
Date: Wed Aug 28 17:38:50 2019 -0300

    Allow removing NFS snapshots in error status

    The NFS driver doesn't allow to delete snapshots in error state when
    snapshot support is disable.

    I'm facing some scenarios where snapshots are enabled then a snapshot
    is created and after that then snapshots are disabled. This results
    in error state snapshots that can't be deleted. Another scenario is
    - with nfs snapshot support disable from the beginning- the API layer
    allows the snapshot to be created but the NFS driver sets the status
    to "error" leaving the snapshot in the DB with error state.
    Because of that, I have snapshots in error state that I'm not able
    to delete.

    The purpose of this fix allow deleting snapshots in error state.
    It makes sense to block creating snapshots when snapshot support is
    False. However, when deleting snapshot we don't want to block
    attempts to delete a broken snapshot DB entry, which is necessary to
    clean up a failed snapshot create.

    Closes-Bug: #1842088
    Change-Id: Ieb19d5e3f58ae2343b6b145772fec33cb7517ab5
    (cherry picked from commit 5714bdb8447a38440585116f784a322143711959)
    (cherry picked from commit 5a4f3ac53a554ecaa18cbd0a49c0606dff4e1137)
    (cherry picked from commit fb0efc42149fab524a9d3a95f01b7b71e954f314)

tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/c/openstack/cinder/+/810406

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 16.4.1

This issue was fixed in the openstack/cinder 16.4.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 17.2.0

This issue was fixed in the openstack/cinder 17.2.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (stable/train)

Reviewed: https://review.opendev.org/c/openstack/cinder/+/810406
Committed: https://opendev.org/openstack/cinder/commit/51a06f3fcc30d0ceb9ccb98560993146e2273090
Submitter: "Zuul (22348)"
Branch: stable/train

commit 51a06f3fcc30d0ceb9ccb98560993146e2273090
Author: Sofia Enriquez <email address hidden>
Date: Wed Aug 28 17:38:50 2019 -0300

    Allow removing NFS snapshots in error status

    The NFS driver doesn't allow to delete snapshots in error state when
    snapshot support is disable.

    I'm facing some scenarios where snapshots are enabled then a snapshot
    is created and after that then snapshots are disabled. This results
    in error state snapshots that can't be deleted. Another scenario is
    - with nfs snapshot support disable from the beginning- the API layer
    allows the snapshot to be created but the NFS driver sets the status
    to "error" leaving the snapshot in the DB with error state.
    Because of that, I have snapshots in error state that I'm not able
    to delete.

    The purpose of this fix allow deleting snapshots in error state.
    It makes sense to block creating snapshots when snapshot support is
    False. However, when deleting snapshot we don't want to block
    attempts to delete a broken snapshot DB entry, which is necessary to
    clean up a failed snapshot create.

    Closes-Bug: #1842088
    Change-Id: Ieb19d5e3f58ae2343b6b145772fec33cb7517ab5
    (cherry picked from commit 5714bdb8447a38440585116f784a322143711959)
    (cherry picked from commit 5a4f3ac53a554ecaa18cbd0a49c0606dff4e1137)
    (cherry picked from commit fb0efc42149fab524a9d3a95f01b7b71e954f314)
    (cherry picked from commit e9ef536958d9920b70cbbf27bc7faf548ad42d36)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder train-eol

This issue was fixed in the openstack/cinder train-eol release.

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.