]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: make mirror properly detect pool replayer needs restart 45086/head
authorMykola Golub <mgolub@suse.com>
Fri, 18 Feb 2022 10:42:23 +0000 (10:42 +0000)
committerMykola Golub <mgolub@suse.com>
Fri, 18 Feb 2022 18:33:20 +0000 (18:33 +0000)
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 <mgolub@suse.com>
src/tools/rbd_mirror/PoolReplayer.cc

index a240b11c45ca3a329e6568844f2fb2140f5a90b2..de0d60241e3fb7085cb3bda5bb80bd6fb2d7dd0b 100644 (file)
@@ -261,7 +261,7 @@ bool PoolReplayer<I>::is_leader() const {
 
 template <typename I>
 bool PoolReplayer<I>::is_running() const {
-  return m_pool_replayer_thread.is_started();
+  return m_pool_replayer_thread.is_started() && !m_stopping;
 }
 
 template <typename I>