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 <arthur.outhenin-chalandre@cern.ch>
This commit is contained in:
Arthur Outhenin-Chalandre 2021-07-28 14:14:47 +02:00
parent 35398a5e17
commit ff60aec2d9
No known key found for this signature in database
GPG Key ID: FC01230D349E61DE
2 changed files with 2 additions and 2 deletions

View 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());
}

View File

@ -112,7 +112,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 ||