From a7b2d4ab30c62db1fecf7ed4565a30de60145416 Mon Sep 17 00:00:00 2001 From: Prasanna Kumar Kalever Date: Tue, 18 Feb 2025 13:12:58 +0530 Subject: [PATCH] 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 --- src/tools/rbd_mirror/group_replayer/BootstrapRequest.cc | 7 +++++++ 1 file changed, 7 insertions(+) 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; -- 2.39.5