Bug 2039274 - rbd: snapshot can't be deleted/unmanaged if its source volume is deleted in ceph
Summary: rbd: snapshot can't be deleted/unmanaged if its source volume is deleted in ceph
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-cinder
Version: 16.1 (Train)
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: z3
: 17.1
Assignee: Eric Harney
QA Contact: Yosi Ben Shimon
RHOS Documentation Team
URL:
Whiteboard:
: 2117852 (view as bug list)
Depends On:
Blocks: 2160510
TreeView+ depends on / blocked
 
Reported: 2022-01-11 12:05 UTC by Takashi Kajinami
Modified: 2024-05-22 20:39 UTC (History)
7 users (show)

Fixed In Version: openstack-cinder-18.2.2-17.1.20231011140828.el9ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-05-22 20:39:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1957073 0 None None None 2022-01-11 12:12:36 UTC
OpenStack gerrit 824149 0 None MERGED rbd: Fix snapshot delete when the source volume doesn't exist 2022-09-22 14:11:50 UTC
Red Hat Issue Tracker OSP-12092 0 None None None 2022-01-11 12:06:04 UTC
Red Hat Issue Tracker OSP-31437 0 None None None 2024-02-14 13:37:10 UTC
Red Hat Product Errata RHBA-2024:2741 0 None None None 2024-05-22 20:39:21 UTC

Description Takashi Kajinami 2022-01-11 12:05:10 UTC
Description of problem:

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 both delete and unmanage operation keep 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.


Version-Release number of selected component (if applicable):
RHOSP16.1.6

How reproducible:
Always

Steps to Reproduce:
1. Create a volume and a snapshot
2. Delete rbd images in the backend ceph pool
3. Delete/Unmanage the snapshot

Actual results:
The snapshot becomes error_deleting/error_unmanaging status

Expected results:
The snapshot is deleted/unmanaged

Additional info:

Comment 2 Takashi Kajinami 2022-01-12 03:23:37 UTC
We solved the issue by creating an empty dummy image in backend.

 # rbd create --size 1 <pool>/volume-<volume id>

We also observe that deleting a volume gets stuck in deleting status
when the actual image doesn't exist in rbd. I'll check some details
and open a separate bug if needed.

Comment 3 Alan Bishop 2022-01-12 21:01:12 UTC
There's a root cause for this, so no need for a separate bug (per comment #2).

The RBD driver does have provision for gracefully handling a request to delete a volume when it's already deleted on the backend, see [1]. The driver also has similar code to handle deleting a snapshot when the snapshot no long exists [2]. However, what's missing is code to handle an error when deleting a snapshot because the parent volume doesn't exist. We need to catch failures that occur at [3].

[1] https://opendev.org/openstack/cinder/src/branch/master/cinder/volume/drivers/rbd.py#L1192
[2] https://opendev.org/openstack/cinder/src/branch/master/cinder/volume/drivers/rbd.py#L1315
[3] https://opendev.org/openstack/cinder/src/branch/master/cinder/volume/drivers/rbd.py#L1289

BTW, deleting the volume fails because of the occur that occurs when first it tries to delete the volume's snapshots.

Comment 4 Rajat Dhasmana 2022-09-23 03:44:36 UTC
*** Bug 2117852 has been marked as a duplicate of this bug. ***

Comment 16 errata-xmlrpc 2024-05-22 20:39:13 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat OpenStack Platform 17.1.3 bug fix and enhancement advisory), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2024:2741


Note You need to log in before you can comment on or make changes to this bug.