From: Jason Dillaman Date: Fri, 22 Feb 2019 18:52:43 +0000 (-0500) Subject: rbd-mirror: failure to initialize pool replayer should stop leader X-Git-Tag: v13.2.7~300^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8b889f56d3ef1ef0cd358fbe8a8fc6b4df8d53b4;p=ceph.git rbd-mirror: failure to initialize pool replayer should stop leader The leader watcher should not start processing requests if it failed to initialize. Signed-off-by: Jason Dillaman (cherry picked from commit 3723d44fa83f38572bf7587e1111005c8ba6ed69) --- diff --git a/src/tools/rbd_mirror/LeaderWatcher.cc b/src/tools/rbd_mirror/LeaderWatcher.cc index f2746c661a1..861c6073074 100644 --- a/src/tools/rbd_mirror/LeaderWatcher.cc +++ b/src/tools/rbd_mirror/LeaderWatcher.cc @@ -902,8 +902,10 @@ void LeaderWatcher::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); }