From 64f9dbdc19feeaa977920283c2a360b237e94f2f Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Tue, 16 Mar 2021 01:27:14 -0400 Subject: [PATCH] mon: check cephfs mirror peer based on remote cluster spec and file system name Signed-off-by: Venky Shankar (cherry picked from commit b625c2634d7c8c8b78e43bc5c9d22b2fa2b8fccc) --- src/mon/FSCommands.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mon/FSCommands.cc b/src/mon/FSCommands.cc index 63ab1594642df..b2c8e1935bf55 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, -- 2.39.5