From: Prasanna Kumar Kalever Date: Tue, 18 Feb 2025 07:42:58 +0000 (+0530) Subject: rbd-mirror: do not move the images to trash while the disabling is in progress X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=132e92a30afa2cedb03c6534cac7332aa2cfb49b;p=ceph.git rbd-mirror: do not move the images to trash while the disabling is in progress Images cannot be moved to trash if the state is disabling because its a transient state where some of the images might have got the oportunity to disable and some of them part of the group might still be enabled waiting for the oportunity while a group disable is in progress. So we wait until the state DISABLING moves to next state, and see if there are any stale image to move into a trash queue later. Signed-off-by: Prasanna Kumar Kalever --- diff --git a/src/tools/rbd_mirror/group_replayer/BootstrapRequest.cc b/src/tools/rbd_mirror/group_replayer/BootstrapRequest.cc index 32cae92110215..cf8ba31559ae2 100644 --- a/src/tools/rbd_mirror/group_replayer/BootstrapRequest.cc +++ b/src/tools/rbd_mirror/group_replayer/BootstrapRequest.cc @@ -913,6 +913,13 @@ void BootstrapRequest::handle_get_local_mirror_image(int r) { << dendl; m_local_images.insert({spec.pool_id, mirror_image.global_image_id}); } else { + if (m_local_mirror_group.state == cls::rbd::MIRROR_GROUP_STATE_DISABLING) { + dout(10) << "local group with global_group_id: " << m_local_mirror_group.global_group_id + << " is in disabling state, will retry later." << dendl; + finish(-ERESTART); + return; + } + dout(10) << "add to trash queue: " << spec.pool_id << " " << spec.image_id << " " << mirror_image.global_image_id << dendl;