From: Mykola Golub Date: Fri, 18 Feb 2022 10:42:23 +0000 (+0000) Subject: rbd-mirror: make mirror properly detect pool replayer needs restart X-Git-Tag: v15.2.17~106^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F45169%2Fhead;p=ceph.git rbd-mirror: make mirror properly detect pool replayer needs restart When a PoolReplayer detects remote pool metadata change it sets "stopping" flag expecting the Mirror will restart it. Although setting "stopping" flag makes the PoolReplayer::run thread to terminate, the thread's is_started function will still return true until join is called (and reset the thread id). This made impossible for the Mirror to detect (by calling PoolReplayer::is_running) that the PoolReplayer needed restart. Fixes: https://tracker.ceph.com/issues/54258 Signed-off-by: Mykola Golub (cherry picked from commit ad4a2990b87834fe4ae8c9111547d071aa6e75e5) --- diff --git a/src/tools/rbd_mirror/PoolReplayer.cc b/src/tools/rbd_mirror/PoolReplayer.cc index 75067813aa59..76808c006612 100644 --- a/src/tools/rbd_mirror/PoolReplayer.cc +++ b/src/tools/rbd_mirror/PoolReplayer.cc @@ -262,7 +262,7 @@ bool PoolReplayer::is_leader() const { template bool PoolReplayer::is_running() const { - return m_pool_replayer_thread.is_started(); + return m_pool_replayer_thread.is_started() && !m_stopping; } template