From: Venky Shankar Date: Tue, 16 Mar 2021 05:27:14 +0000 (-0400) Subject: mon: check cephfs mirror peer based on remote cluster spec and file system name X-Git-Tag: v16.2.0~34^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=64f9dbdc19feeaa977920283c2a360b237e94f2f;p=ceph.git mon: check cephfs mirror peer based on remote cluster spec and file system name Signed-off-by: Venky Shankar (cherry picked from commit b625c2634d7c8c8b78e43bc5c9d22b2fa2b8fccc) --- diff --git a/src/mon/FSCommands.cc b/src/mon/FSCommands.cc index 63ab1594642d..b2c8e1935bf5 100644 --- a/src/mon/FSCommands.cc +++ b/src/mon/FSCommands.cc @@ -1150,6 +1150,11 @@ public: ss << "peer already exists"; return true; } + if (fs->mirror_info.has_peer((*remote_conf).first, (*remote_conf).second, + remote_fs_name)) { + ss << "peer already exists"; + return true; + } auto f = [peer_uuid, remote_conf, remote_fs_name](auto &&fs) { fs->mirror_info.peer_add(peer_uuid, (*remote_conf).first,