From: Jason Dillaman Date: Tue, 7 Jun 2016 18:45:16 +0000 (-0400) Subject: rbd-mirror: stop external replayer before closing remote journaler X-Git-Tag: v11.0.0~243^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=88bd3002082184c045bb82547929b30da1526cfb;p=ceph.git rbd-mirror: stop external replayer before closing remote journaler Signed-off-by: Jason Dillaman --- diff --git a/src/tools/rbd_mirror/ImageReplayer.cc b/src/tools/rbd_mirror/ImageReplayer.cc index 90961eb2d9d..d35f542bd3a 100644 --- a/src/tools/rbd_mirror/ImageReplayer.cc +++ b/src/tools/rbd_mirror/ImageReplayer.cc @@ -1157,6 +1157,16 @@ void ImageReplayer::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) { @@ -1170,16 +1180,6 @@ void ImageReplayer::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;