]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: make mirror properly detect pool replayer needs restart 45169/head
authorMykola Golub <mgolub@suse.com>
Fri, 18 Feb 2022 10:42:23 +0000 (10:42 +0000)
committerPonnuvel Palaniyappan <pponnuvel@gmail.com>
Fri, 25 Feb 2022 18:27:55 +0000 (18:27 +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>
(cherry picked from commit ad4a2990b87834fe4ae8c9111547d071aa6e75e5)

src/tools/rbd_mirror/PoolReplayer.cc

index 75067813aa59db992cd81d3309594e7210f0de66..76808c00661222c5e49936d2cb70d62e4717551c 100644 (file)
@@ -262,7 +262,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>