From 9d79a4dd47397bc064b55db224a692148108e2b9 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Sun, 12 Jan 2020 10:05:04 -0500 Subject: [PATCH] rbd-mirror: skip closing local image if it was already closed If the journal replayer finishes relaying (error or promotion), it will close the local image. However, the image replayer state machine will also shut down the journal replayer (again) which might result in attempting to close the local image again. Signed-off-by: Jason Dillaman --- src/tools/rbd_mirror/image_replayer/journal/Replayer.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tools/rbd_mirror/image_replayer/journal/Replayer.cc b/src/tools/rbd_mirror/image_replayer/journal/Replayer.cc index 87290b055018..4b6778e14550 100644 --- a/src/tools/rbd_mirror/image_replayer/journal/Replayer.cc +++ b/src/tools/rbd_mirror/image_replayer/journal/Replayer.cc @@ -468,6 +468,10 @@ void Replayer::handle_wait_for_event_replay(int r) { template void Replayer::close_local_image() { ceph_assert(ceph_mutex_is_locked_by_me(m_lock)); + if (m_state_builder->local_image_ctx == nullptr) { + stop_remote_journaler_replay(); + return; + } dout(10) << dendl; if (m_local_journal_listener != nullptr) { -- 2.47.3