]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rbd-mirror: shut down and remove pool replayer if peer changes
authorIlya Dryomov <idryomov@gmail.com>
Wed, 24 Apr 2024 12:42:38 +0000 (14:42 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 7 May 2024 08:02:27 +0000 (10:02 +0200)
commit90f44d53f39d0acb127e2c1c3533d362cba2d490
treeae5446d77db6d93e7c8f72fbea95ae131f72e4dc
parent96805dcf909541c4ca9a1e90258de8ae5b6fa1bc
rbd-mirror: shut down and remove pool replayer if peer changes

The code in Mirror::update_pool_replayers() responsible for shutting
down and removing stale pool replayers kicks in only in case the peer
is removed, but not if the peer changes.  However, the code responsible
for (re)starting pool replayers in the same method _does_ create and
start a new pool replayer in that case.  As a result, we can end up
with nearly identical pool replayers running at the same time, hogging
OS resources and confusing instance_id tracking logic and mirror status
reporting at the very least.

The root cause is that PeerSpec is matched normally (i.e. based on all
fields) when it comes to m_pool_replayers, and based only on UUID when
it comes to pool_peers.  This was missed in commit 5463e1a1e1b7
("rbd-mirror: extract optional peer mon_host/key values from MON").

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit def93cb0ad93e3e27d7c4534f68c95ef922ab750)
src/tools/rbd_mirror/Mirror.cc