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: v18.0.0~1351^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=ad4a2990b87834fe4ae8c9111547d071aa6e75e5;p=ceph-ci.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 --- diff --git a/src/tools/rbd_mirror/PoolReplayer.cc b/src/tools/rbd_mirror/PoolReplayer.cc index a240b11c45c..de0d60241e3 100644 --- a/src/tools/rbd_mirror/PoolReplayer.cc +++ b/src/tools/rbd_mirror/PoolReplayer.cc @@ -261,7 +261,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