From d47ddd998f096a77b4052c537ff11503c537cd79 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Thu, 17 Jun 2021 18:09:31 +0300 Subject: [PATCH] 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 --- src/tools/rbd_mirror/ImageReplayer.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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( -- 2.47.3