]> git.apps.os.sepia.ceph.com Git - ceph-ci.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>
Mon, 25 Feb 2019 19:22:25 +0000 (14:22 -0500)
The leader watcher should not start processing requests if it failed
to initialize.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/tools/rbd_mirror/LeaderWatcher.cc

index d1386ba746fc0107e0a5686cb62943a7b60b991c..f3291bc60962a242ce5ddd4c3f6aa431eefe8b20 100644 (file)
@@ -902,8 +902,10 @@ void LeaderWatcher<I>::handle_notify_lock_acquired(int r) {
     ceph_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);
 }