From 8b889f56d3ef1ef0cd358fbe8a8fc6b4df8d53b4 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Fri, 22 Feb 2019 13:52:43 -0500 Subject: [PATCH] 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) --- src/tools/rbd_mirror/LeaderWatcher.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tools/rbd_mirror/LeaderWatcher.cc b/src/tools/rbd_mirror/LeaderWatcher.cc index f2746c661a103..861c6073074d7 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); } -- 2.39.5