From: Arthur Outhenin-Chalandre Date: Wed, 28 Jul 2021 12:14:47 +0000 (+0200) Subject: rbd-mirror: fix bootstrap sequence while the image is removed X-Git-Tag: v15.2.16~33^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=195f38e63a030126ad604b5abb07777025b5c4e7;p=ceph.git rbd-mirror: fix bootstrap sequence while the image is removed 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 (cherry picked from commit ff60aec2d9efa1842383ba0a5c3bd6b5a29389c6) --- diff --git a/src/test/rbd_mirror/test_ImageReplayer.cc b/src/test/rbd_mirror/test_ImageReplayer.cc index ed3f9cbca2a..65db2faeee8 100644 --- a/src/test/rbd_mirror/test_ImageReplayer.cc +++ b/src/test/rbd_mirror/test_ImageReplayer.cc @@ -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()); } diff --git a/src/tools/rbd_mirror/image_replayer/PrepareRemoteImageRequest.cc b/src/tools/rbd_mirror/image_replayer/PrepareRemoteImageRequest.cc index 3231d5fa023..e4309cde37f 100644 --- a/src/tools/rbd_mirror/image_replayer/PrepareRemoteImageRequest.cc +++ b/src/tools/rbd_mirror/image_replayer/PrepareRemoteImageRequest.cc @@ -111,7 +111,7 @@ void PrepareRemoteImageRequest::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 ||