From: Ilya Dryomov Date: Mon, 20 Sep 2021 19:52:57 +0000 (+0200) Subject: rbd-mirror: unbreak one-way snapshot-based mirroring X-Git-Tag: v16.2.7~18^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4b8e1894545119c4d2498405119c2cd3f190d699;p=ceph.git rbd-mirror: unbreak one-way snapshot-based mirroring Snapshot replayer needs the remote's mirror peer uuid to find its snapshots in the remote image. It is obtained by listing remote's mirror peers but RemotePoolPoller::handle_mirror_peer_list() skips tx-only (MIRROR_PEER_DIRECTION_TX) peers. In effect only rx-tx (MIRROR_PEER_DIRECTION_RX_TX) peers are considered for matching and snapshot replayer always fails with "failed to retrieve mirror peer uuid from remote pool" error. Instead, skip rx-only (MIRROR_PEER_DIRECTION_RX) peers as we are definitely not interested in anything having to do with mirroring _to_ the remote cluster. Fixes: https://tracker.ceph.com/issues/52675 Signed-off-by: Ilya Dryomov (cherry picked from commit b02d3b0c5aa59aa294de43f94c793f5abf71ac03) --- diff --git a/src/tools/rbd_mirror/RemotePoolPoller.cc b/src/tools/rbd_mirror/RemotePoolPoller.cc index 4f5994f1da678..1ff2e41fc46d1 100644 --- a/src/tools/rbd_mirror/RemotePoolPoller.cc +++ b/src/tools/rbd_mirror/RemotePoolPoller.cc @@ -183,7 +183,7 @@ void RemotePoolPoller::handle_mirror_peer_list(int r) { cls::rbd::MirrorPeer* matched_peer = nullptr; for (auto& peer : peers) { - if (peer.mirror_peer_direction == cls::rbd::MIRROR_PEER_DIRECTION_TX) { + if (peer.mirror_peer_direction == cls::rbd::MIRROR_PEER_DIRECTION_RX) { continue; }