]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: do not move the images to trash while the disabling is in progress
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Tue, 18 Feb 2025 07:42:58 +0000 (13:12 +0530)
committerPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Thu, 24 Apr 2025 15:56:30 +0000 (21:26 +0530)
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 <prasanna.kalever@redhat.com>
src/tools/rbd_mirror/group_replayer/BootstrapRequest.cc

index 32cae9211021527b66b53dee405cdd606bf93ba6..cf8ba31559ae2be12b21a2d665ca9676208f24d5 100644 (file)
@@ -913,6 +913,13 @@ void BootstrapRequest<I>::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;