From 73a0be9ac1efe61bfcd08c29a23d26b0a23b28aa Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Wed, 15 Jan 2020 15:01:43 -0500 Subject: [PATCH] rbd-mirror: do not run pool replayers against TX-only peers Now that we track RX and TX states of peers, any peers that are listed as TX only should be excluded from image replaying. Signed-off-by: Jason Dillaman --- src/tools/rbd_mirror/ClusterWatcher.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/tools/rbd_mirror/ClusterWatcher.cc b/src/tools/rbd_mirror/ClusterWatcher.cc index b69475e04af..2ae1306be5a 100644 --- a/src/tools/rbd_mirror/ClusterWatcher.cc +++ b/src/tools/rbd_mirror/ClusterWatcher.cc @@ -151,7 +151,14 @@ void ClusterWatcher::read_pool_peers(PoolPeers *pool_peers) continue; } - std::vector peers{configs.begin(), configs.end()}; + std::vector peers; + peers.reserve(configs.size()); + for (auto& peer : configs) { + if (peer.direction != RBD_MIRROR_PEER_DIRECTION_TX) { + peers.push_back(peer); + } + } + for (auto& peer : peers) { r = resolve_peer_site_config_keys(pool_id, pool_name, &peer); if (r < 0) { -- 2.47.3