]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: fix bootstrap sequence while the image is removed
authorArthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
Wed, 28 Jul 2021 12:14:47 +0000 (14:14 +0200)
committerArthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
Wed, 12 Jan 2022 09:03:41 +0000 (10:03 +0100)
If the image is being removed the PrepareRemoteImageRequest was
returning the same error if the image was disabled or non primary which
doesn't allow the BootstrapRequest to have the correct error handling.

This commit fix this behavior by considering that the remote image is
already deleted if the image is in disabling state.

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@cern.ch>
(cherry picked from commit ff60aec2d9efa1842383ba0a5c3bd6b5a29389c6)

src/test/rbd_mirror/test_ImageReplayer.cc
src/tools/rbd_mirror/image_replayer/PrepareRemoteImageRequest.cc

index ed3f9cbca2ac43883f641b91567c9ea098794c40..65db2faeee89488f4b867578a9c35afecdbfd8de 100644 (file)
@@ -664,7 +664,7 @@ TYPED_TEST(TestImageReplayer, BootstrapMirrorDisabling)
   this->create_replayer();
   C_SaferCond cond;
   this->m_replayer->start(&cond);
-  ASSERT_EQ(-EREMOTEIO, cond.wait());
+  ASSERT_EQ(-ENOENT, cond.wait());
   ASSERT_TRUE(this->m_replayer->is_stopped());
 }
 
index 3231d5fa02397f1f8bde18977becd1688ea7b58f..e4309cde37fdcfd2499f5616e7488394ac1297d2 100644 (file)
@@ -111,7 +111,7 @@ void PrepareRemoteImageRequest<I>::handle_get_mirror_info(int r) {
     return;
   } else if (m_mirror_image.state == cls::rbd::MIRROR_IMAGE_STATE_DISABLING) {
     dout(5) << "remote image mirroring is being disabled" << dendl;
-    finish(-EREMOTEIO);
+    finish(-ENOENT);
     return;
   } else if (m_promotion_state != librbd::mirror::PROMOTION_STATE_PRIMARY &&
              (state_builder == nullptr ||