]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd_mirror: properly handle image replay canceled when starting replay 41792/head
authorMykola Golub <mgolub@suse.com>
Thu, 17 Jun 2021 15:09:31 +0000 (18:09 +0300)
committerMykola Golub <mgolub@suse.com>
Fri, 18 Jun 2021 05:35:09 +0000 (08:35 +0300)
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 <mgolub@suse.com>
src/tools/rbd_mirror/ImageReplayer.cc

index 7c7e87a988d6643759488696653cbdd27a0ddaed..280abc47a2f3b4ae67db43e04bf766ce540ebb32 100644 (file)
@@ -639,7 +639,9 @@ template <typename I>
 void ImageReplayer<I>::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<I>::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<CephContext *>(m_local->cct());
     double poll_seconds = cct->_conf.get_val<double>(