]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: stop external replayer before closing remote journaler
authorJason Dillaman <dillaman@redhat.com>
Tue, 7 Jun 2016 18:45:16 +0000 (14:45 -0400)
committerJason Dillaman <dillaman@redhat.com>
Fri, 10 Jun 2016 16:44:45 +0000 (12:44 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 88bd3002082184c045bb82547929b30da1526cfb)

src/tools/rbd_mirror/ImageReplayer.cc

index 42c90cd44908b49689de7c9b7d831718c5e92b8f..10ad65eda08164798a444ed91e09f5cdeaaad528 100644 (file)
@@ -1163,6 +1163,16 @@ void ImageReplayer<I>::shut_down(int r, Context *on_start) {
       request->send();
     });
   }
+  if (m_remote_journaler != nullptr) {
+    ctx = new FunctionContext([this, ctx](int r) {
+        delete m_remote_journaler;
+        m_remote_journaler = nullptr;
+        ctx->complete(0);
+      });
+    ctx = new FunctionContext([this, ctx](int r) {
+        m_remote_journaler->shut_down(ctx);
+      });
+  }
   if (m_local_replay != nullptr) {
     ctx = new FunctionContext([this, ctx](int r) {
         if (r < 0) {
@@ -1176,16 +1186,6 @@ void ImageReplayer<I>::shut_down(int r, Context *on_start) {
         m_local_replay->shut_down(true, ctx);
       });
   }
-  if (m_remote_journaler != nullptr) {
-    ctx = new FunctionContext([this, ctx](int r) {
-        delete m_remote_journaler;
-        m_remote_journaler = nullptr;
-        ctx->complete(0);
-      });
-    ctx = new FunctionContext([this, ctx](int r) {
-        m_remote_journaler->shut_down(ctx);
-      });
-  }
   if (m_replay_handler != nullptr) {
     ctx = new FunctionContext([this, ctx](int r) {
         delete m_replay_handler;