From 5b95c8303a936f81882f1cd81cde71bc6c3219f2 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Fri, 18 Feb 2022 10:42:23 +0000 Subject: [PATCH] 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) --- src/tools/rbd_mirror/PoolReplayer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/rbd_mirror/PoolReplayer.cc b/src/tools/rbd_mirror/PoolReplayer.cc index a240b11c45ca3..de0d60241e3fb 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 -- 2.39.5