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: v16.2.7~65^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ee55a8ca059c69ce66785bd690db9d98ed2ba628;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 cb21fc72396..76a6919d5ad 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 54a9dbf1650..08d3dd7806f 100644 --- a/src/tools/rbd_mirror/image_replayer/PrepareRemoteImageRequest.cc +++ b/src/tools/rbd_mirror/image_replayer/PrepareRemoteImageRequest.cc @@ -112,7 +112,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 ||