From: Jason Dillaman Date: Wed, 15 Jan 2020 20:01:43 +0000 (-0500) Subject: rbd-mirror: do not run pool replayers against TX-only peers X-Git-Tag: v15.1.0~175^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=73a0be9ac1efe61bfcd08c29a23d26b0a23b28aa;p=ceph.git 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 --- 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) {