]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: skip closing local image if it was already closed 32578/head
authorJason Dillaman <dillaman@redhat.com>
Sun, 12 Jan 2020 15:05:04 +0000 (10:05 -0500)
committerJason Dillaman <dillaman@redhat.com>
Sun, 12 Jan 2020 15:05:04 +0000 (10:05 -0500)
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 <dillaman@redhat.com>
src/tools/rbd_mirror/image_replayer/journal/Replayer.cc

index 87290b0550183dde9390f12923b20a9ad6c4a204..4b6778e145502c0bcb5329918a33b5142d168e25 100644 (file)
@@ -468,6 +468,10 @@ void Replayer<I>::handle_wait_for_event_replay(int r) {
 template <typename I>
 void Replayer<I>::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) {