Actions
Bug #65698
openmgr/dashboard: RBD snapshots cloned (format v2) and then deleted causes Not Found/404 in the source RBD Image
Status:
Pending Backport
Priority:
Urgent
Assignee:
Category:
Component - RBD
Target version:
-
% Done:
0%
Source:
Development
Tags:
backport_processed
Backport:
reef squid quincy
Regression:
No
Severity:
2 - major
Reviewed:
Affected Versions:
Ceph - v13.0.0, Ceph - v13.2.0, Ceph - v13.2.1, Ceph - v13.2.10, Ceph - v13.2.11, Ceph - v13.2.2, Ceph - v13.2.3, Ceph - v13.2.4, Ceph - v13.2.5, Ceph - v13.2.6, Ceph - v13.2.7, Ceph - v13.2.8, Ceph - v13.2.9, Ceph - v14.0.0, Ceph - v14.2.0, Ceph - v14.2.1, Ceph - v14.2.10, Ceph - v14.2.11, Ceph - v14.2.12, Ceph - v14.2.13, Ceph - v14.2.14, Ceph - v14.2.15, Ceph - v14.2.16, Ceph - v14.2.17, Ceph - v14.2.18, Ceph - v14.2.19, Ceph - v14.2.2, Ceph - v14.2.20, Ceph - v14.2.21, Ceph - v14.2.22, Ceph - v14.2.23, Ceph - v14.2.3, Ceph - v14.2.4, Ceph - v14.2.5, Ceph - v14.2.6, Ceph - v14.2.7, Ceph - v14.2.8, Ceph - v14.2.9, Ceph - v15.0.0, Ceph - v15.2.1, Ceph - v15.2.10, Ceph - v15.2.11, Ceph - v15.2.12, Ceph - v15.2.13, Ceph - v15.2.14, Ceph - v15.2.15, Ceph - v15.2.16, Ceph - v15.2.17, Ceph - v15.2.2, Ceph - v15.2.3, Ceph - v15.2.4, Ceph - v15.2.5, Ceph - v15.2.6, Ceph - v15.2.7, Ceph - v15.2.8, Ceph - v15.2.9, Ceph - v16.0.0, Ceph - v16.0.1, Ceph - v16.1.0, Ceph - v16.1.1, Ceph - v16.2.0, Ceph - v16.2.1, Ceph - v16.2.10, Ceph - v16.2.11, Ceph - v16.2.12, Ceph - v16.2.13, Ceph - v16.2.14, Ceph - v16.2.15, Ceph - v16.2.2, Ceph - v16.2.3, Ceph - v16.2.4, Ceph - v16.2.5, Ceph - v16.2.6, Ceph - v16.2.7, Ceph - v16.2.8, Ceph - v16.2.9, Ceph - v17.0.0, Ceph - v17.2.1, Ceph - v17.2.2, Ceph - v17.2.3, Ceph - v17.2.4, Ceph - v17.2.5, Ceph - v17.2.6, Ceph - v17.2.7, Ceph - v17.2.8, Ceph - v18.0.0, Ceph - v18.1.0, Ceph - v18.1.1, Ceph - v18.1.2, Ceph - v18.1.3, Ceph - v18.2.0, Ceph - v18.2.1, Ceph - v18.2.2, Ceph - v18.2.3, Ceph - v19.1.0, Ceph - v20.0.0
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Description
Starting with mimic/RBD clone format 2, snapshots don't require protection to be cloned. What it happens under the hood is that snapshot with clones, when deleted, are moved to the trash namespace (ID=2). However, these snapshots are still listed when using img.list_snaps()
.
- Update cluster setting:
ceph osd set-require-min-compat-client mimic --yes-i-really-mean-it
- Create RBD image:
rbd create test_img --size 10G
- Create RBD snapshot:
rbd snap create test_img@test_snap
- Create RBD clone (format 2):
rbd clone test_img@test_snap test_clone
- Delete snapshot:
rbd snap rm test_img@test_snap
The following code:
import rados, rbd
cluster = rados.Rados(conffile = '/etc/ceph/ceph.conf', conf = dict (keyring = '/etc/ceph/ceph.keyring'))
cluster.connect()
ioctx = cluster.open_ioctx('rbd')
# Opening an RBD image with a cloned-and-then-deleted snapshot
img = rbd.Image(ioctx, 'test_img')
# This works
>>> for snap in img.list_snaps(): print(snap)
{'id': 33, 'size': 1073741824, 'name': '0a0daa4f-092d-4784-98e5-a87921d45aba', 'namespace': 2, 'trash': {'original_name': 'test_snap'}}
{'id': 34, 'size': 1073741824, 'name': 'new_one', 'namespace': 0}
# This breaks
for snap in img.list_snaps(): img.is_protected_snap(snap['name'])
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "rbd.pyx", line 2774, in rbd.requires_not_closed.wrapper
File "rbd.pyx", line 3668, in rbd.Image.is_protected_snap
rbd.ImageNotFound: [errno 2] RBD image not found (error checking if snapshot b'test_snap'@b'0a0daa4f-092d-4784-98e5-a87921d45aba' is protected)
The solution proposed by Ilya is to filter out images belonging to namespace == RBD_SNAP_NAMESPACE_TYPE_TRASH
.
Updated by Nizamudeen A 15 days ago
- Status changed from In Progress to Pending Backport
- Pull request ID set to 57151
Updated by Backport Bot 15 days ago
- Copied to Backport #65756: reef: mgr/dashboard: RBD snapshots cloned (format v2) and then deleted causes Not Found/404 in the source RBD Image added
Updated by Backport Bot 15 days ago
- Copied to Backport #65758: squid: mgr/dashboard: RBD snapshots cloned (format v2) and then deleted causes Not Found/404 in the source RBD Image added
Updated by Backport Bot 15 days ago
- Copied to Backport #65759: quincy: mgr/dashboard: RBD snapshots cloned (format v2) and then deleted causes Not Found/404 in the source RBD Image added
Actions