From 43f3bbf130c9914f895bf4834305f951d0228954 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Tue, 7 Jun 2016 14:45:16 -0400 Subject: [PATCH] rbd-mirror: stop external replayer before closing remote journaler Signed-off-by: Jason Dillaman (cherry picked from commit 88bd3002082184c045bb82547929b30da1526cfb) --- src/tools/rbd_mirror/ImageReplayer.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/tools/rbd_mirror/ImageReplayer.cc b/src/tools/rbd_mirror/ImageReplayer.cc index 42c90cd44908b..10ad65eda0816 100644 --- a/src/tools/rbd_mirror/ImageReplayer.cc +++ b/src/tools/rbd_mirror/ImageReplayer.cc @@ -1163,6 +1163,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) { @@ -1176,16 +1186,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; -- 2.39.5