]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd/image: create rbd_trash object during RBD pool initialization
authorRamana Raja <rraja@redhat.com>
Tue, 30 Apr 2024 17:56:12 +0000 (13:56 -0400)
committerRamana Raja <rraja@redhat.com>
Tue, 21 May 2024 18:47:24 +0000 (14:47 -0400)
commit72d6407eb9816c04eec12944e99932ed7545a88f
tree3b569c48ed0684eccebf8542f0cc83d759ce1197
parente29be42fec0305c8a29767ba7edf6a5ba3293878
librbd/image: create rbd_trash object during RBD pool initialization

... and RBD namespace creation.

It was not possible to remove a RBD image when OSDs were full and the
'rbd_trash' object was not already created in the image's pool or pool
namespace. The 'rbd_trash' object was created in a pool or namespace
during the first instance of image removal from the pool or namespace.
If no images were ever removed from a RBD pool or namespace and the
OSDs became full, removal of images using the CLI failed. The failure
occured when trying to move the images to trash since the 'rbd_trash'
object was missing in the pool or namespace.

Fix this issue by creating the rbd_trash object in a pool when
initalizing the pool as a RBD pool and when creating a RBD namespace.

Fixes: https://tracker.ceph.com/issues/64800
Signed-off-by: Ramana Raja <rraja@redhat.com>
(cherry picked from commit 0bcb5cfce9a242d6f991126524203f90741cfecf)
src/librbd/api/Namespace.cc
src/librbd/api/Pool.cc
src/test/librbd/test_librbd.cc