From: Mykola Golub Date: Thu, 17 Jun 2021 15:09:31 +0000 (+0300) Subject: rbd_mirror: properly handle image replay canceled when starting replay X-Git-Tag: v14.2.22~1^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d47ddd998f096a77b4052c537ff11503c537cd79;p=ceph.git rbd_mirror: properly handle image replay canceled when starting replay It fixes the bug when the handle_start_replay detected the cancel when it called on_replay_interrupted and returned without completing m_on_start_finish context. This is a direct commit to nautilus. The bug was accidentally fixed in newer versions during refactoring. Signed-off-by: Mykola Golub --- diff --git a/src/tools/rbd_mirror/ImageReplayer.cc b/src/tools/rbd_mirror/ImageReplayer.cc index 7c7e87a988d6..280abc47a2f3 100644 --- a/src/tools/rbd_mirror/ImageReplayer.cc +++ b/src/tools/rbd_mirror/ImageReplayer.cc @@ -639,7 +639,9 @@ template void ImageReplayer::handle_start_replay(int r) { dout(10) << "r=" << r << dendl; - if (r < 0) { + if (on_start_interrupted()) { + return; + } else if (r < 0) { ceph_assert(m_local_replay == nullptr); derr << "error starting external replay on local image " << m_local_image_id << ": " << cpp_strerror(r) << dendl; @@ -665,10 +667,6 @@ void ImageReplayer::handle_start_replay(int r) { update_mirror_image_status(true, boost::none); reschedule_update_status_task(30); - if (on_replay_interrupted()) { - return; - } - { CephContext *cct = static_cast(m_local->cct()); double poll_seconds = cct->_conf.get_val(