]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: failure to initialize pool replayer should stop leader
authorJason Dillaman <dillaman@redhat.com>
Fri, 22 Feb 2019 18:52:43 +0000 (13:52 -0500)
committerJason Dillaman <dillaman@redhat.com>
Thu, 16 May 2019 13:42:48 +0000 (09:42 -0400)
The leader watcher should not start processing requests if it failed
to initialize.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 3723d44fa83f38572bf7587e1111005c8ba6ed69)

src/tools/rbd_mirror/LeaderWatcher.cc

index f2746c661a1039e5075fbd26e0f054c1925e66ca..861c6073074d7bd368150aa29459b94ca781a101 100644 (file)
@@ -902,8 +902,10 @@ void LeaderWatcher<I>::handle_notify_lock_acquired(int r) {
     assert(m_on_finish != nullptr);
     std::swap(m_on_finish, on_finish);
 
-    // listener should be ready for instance add/remove events now
-    m_instances->unblock_listener();
+    if (m_ret_val == 0) {
+      // listener should be ready for instance add/remove events now
+      m_instances->unblock_listener();
+    }
   }
   on_finish->complete(0);
 }