]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: do not run pool replayers against TX-only peers
authorJason Dillaman <dillaman@redhat.com>
Wed, 15 Jan 2020 20:01:43 +0000 (15:01 -0500)
committerJason Dillaman <dillaman@redhat.com>
Wed, 15 Jan 2020 20:01:43 +0000 (15:01 -0500)
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 <dillaman@redhat.com>
src/tools/rbd_mirror/ClusterWatcher.cc

index b69475e04af8aa3843a671e6a7b8ba4f8c7d241c..2ae1306be5a3dde6cddc8b2f7b0a5e58577fe315 100644 (file)
@@ -151,7 +151,14 @@ void ClusterWatcher::read_pool_peers(PoolPeers *pool_peers)
       continue;
     }
 
-    std::vector<PeerSpec> peers{configs.begin(), configs.end()};
+    std::vector<PeerSpec> 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) {