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)