rbd: snapshot can't be deleted if its source volume is deleted from backend

Bug #1957073 reported by Takashi Kajinami
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Takashi Kajinami

Bug Description

Description
===========
A user encountered the situation where they need to clear data in their ceph cluster and started the cluster from scratch.
After re-initializing the cluster, they tried to remove a snapshot record left in cinder db but delete operation keeps failing.

It seems the problem is that the rbd driver tries to access the source volume first, and the operations fails if the source volume doesn't exist.

How reproducible
==================
Always

Steps to reproduce
==================
1. Create a volume and a snapshot
2. Delete rbd images in the backend ceph pool
3. Delete the snapshot

Expected results
==================
The snapshot is deleted

Actual results
==================
The snapshot becomes error_deleting status

Environment
==================
This issue was initially found in stable/train based deployment

Logs & Configs
==============
N/A

Note
==============
The same problem is found in unmanage but in this but we focus on delete.

description: updated
summary: - rbd: snapshot can't be deleted if the snapshot and its source volume are
- both deleted
+ rbd: snapshot can't be deleted/unmanaged if its source volume is deleted
+ in ceph
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/cinder/+/824149

Changed in cinder:
status: New → In Progress
Changed in cinder:
assignee: nobody → Takashi Kajinami (kajinamit)
summary: rbd: snapshot can't be deleted/unmanaged if its source volume is deleted
- in ceph
+ from backend
Changed in cinder:
importance: Undecided → Medium
tags: added: rbd snapshot snapshot-delete snapshot-unmanaging
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.opendev.org/c/openstack/cinder/+/824149
Committed: https://opendev.org/openstack/cinder/commit/3ddf7ca9ea9587318b8c903e2c43b1879846d1c2
Submitter: "Zuul (22348)"
Branch: master

commit 3ddf7ca9ea9587318b8c903e2c43b1879846d1c2
Author: Takashi Kajinami <email address hidden>
Date: Tue Jan 11 21:22:52 2022 +0900

    rbd: Fix snapshot delete when the source volume doesn't exist

    Currently snapshot delete requires access to the source volume and
    the operation fails if the source volume doesn't exist in the backend.
    This prevents some snapshots from being deleted when the source volume
    image is deleted from the backend for some reason (for example, after
    cluster format).

    This change makes the rbd driver to skip updating the source volume
    if it doesn't exist. A warning log is left so that operators can be
    aware of any skip event.

    Closes-Bug: #1957073
    Change-Id: Icd9dad9ad7b3ad71b3962b078e5b94670ac41c87

Changed in cinder:
status: In Progress → Fix Released
summary: - rbd: snapshot can't be deleted/unmanaged if its source volume is deleted
- from backend
+ rbd: snapshot can't be deleted if its source volume is deleted from
+ backend
description: updated
tags: removed: snapshot-unmanaging
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/yoga)

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

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

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

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

Reviewed: https://review.opendev.org/c/openstack/cinder/+/858624
Committed: https://opendev.org/openstack/cinder/commit/cf108981432d35049bf28010d3191fd9f4b82ccc
Submitter: "Zuul (22348)"
Branch: stable/zed

commit cf108981432d35049bf28010d3191fd9f4b82ccc
Author: Takashi Kajinami <email address hidden>
Date: Tue Jan 11 21:22:52 2022 +0900

    rbd: Fix snapshot delete when the source volume doesn't exist

    Currently snapshot delete requires access to the source volume and
    the operation fails if the source volume doesn't exist in the backend.
    This prevents some snapshots from being deleted when the source volume
    image is deleted from the backend for some reason (for example, after
    cluster format).

    This change makes the rbd driver to skip updating the source volume
    if it doesn't exist. A warning log is left so that operators can be
    aware of any skip event.

    Closes-Bug: #1957073
    Change-Id: Icd9dad9ad7b3ad71b3962b078e5b94670ac41c87
    (cherry picked from commit 3ddf7ca9ea9587318b8c903e2c43b1879846d1c2)

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

This issue was fixed in the openstack/cinder 21.0.0.0rc2 release candidate.

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

Reviewed: https://review.opendev.org/c/openstack/cinder/+/858463
Committed: https://opendev.org/openstack/cinder/commit/43fd2fadb7ce06a435967884124a69c96bb47d00
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit 43fd2fadb7ce06a435967884124a69c96bb47d00
Author: Takashi Kajinami <email address hidden>
Date: Tue Jan 11 21:22:52 2022 +0900

    rbd: Fix snapshot delete when the source volume doesn't exist

    Currently snapshot delete requires access to the source volume and
    the operation fails if the source volume doesn't exist in the backend.
    This prevents some snapshots from being deleted when the source volume
    image is deleted from the backend for some reason (for example, after
    cluster format).

    This change makes the rbd driver to skip updating the source volume
    if it doesn't exist. A warning log is left so that operators can be
    aware of any skip event.

    This commit also includes a squash to add a releasenote from
    I40f6eb1f104da4410d32410940824a88f7d1ec62 to reduce backporting
    workload.

    Closes-Bug: #1957073
    Change-Id: Icd9dad9ad7b3ad71b3962b078e5b94670ac41c87
    (cherry picked from commit 3ddf7ca9ea9587318b8c903e2c43b1879846d1c2)
    (cherry picked from commit cf108981432d35049bf28010d3191fd9f4b82ccc)

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

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

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

Reviewed: https://review.opendev.org/c/openstack/cinder/+/864171
Committed: https://opendev.org/openstack/cinder/commit/4c7dbde4401aba24ee58f526fc98976580d64e62
Submitter: "Zuul (22348)"
Branch: stable/xena

commit 4c7dbde4401aba24ee58f526fc98976580d64e62
Author: Takashi Kajinami <email address hidden>
Date: Tue Jan 11 21:22:52 2022 +0900

    rbd: Fix snapshot delete when the source volume doesn't exist

    Currently snapshot delete requires access to the source volume and
    the operation fails if the source volume doesn't exist in the backend.
    This prevents some snapshots from being deleted when the source volume
    image is deleted from the backend for some reason (for example, after
    cluster format).

    This change makes the rbd driver to skip updating the source volume
    if it doesn't exist. A warning log is left so that operators can be
    aware of any skip event.

    This commit also includes a squash to add a releasenote from
    I40f6eb1f104da4410d32410940824a88f7d1ec62 to reduce backporting
    workload.

    Closes-Bug: #1957073
    Change-Id: Icd9dad9ad7b3ad71b3962b078e5b94670ac41c87
    (cherry picked from commit 3ddf7ca9ea9587318b8c903e2c43b1879846d1c2)
    (cherry picked from commit cf108981432d35049bf28010d3191fd9f4b82ccc)
    (cherry picked from commit 43fd2fadb7ce06a435967884124a69c96bb47d00)

tags: added: in-stable-xena
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/+/865725

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

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

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

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

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

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (stable/wallaby)

Change abandoned by "Elod Illes <email address hidden>" on branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/cinder/+/865725
Reason: stable/wallaby branch of openstack/cinder is about to be deleted. To be able to do that, all open patches need to be abandoned. Please cherry pick the patch to unmaintained/wallaby if you want to further work on this patch.

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.