From: Hao Xiong Date: Sun, 17 Nov 2019 05:41:04 +0000 (+0800) Subject: remove the restriction of address type in init_with_hosts when build initial monmap X-Git-Tag: v14.2.8~20^2~76^2~13^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F31844%2Fhead;p=ceph.git remove the restriction of address type in init_with_hosts when build initial monmap Signed-off-by: Hao Xiong (cherry picked from commit 0c2da4b21a4df379f580472dc418809eb7622ee0) Conflicts: src/mon/MonMap.cc - bf7490bf7c0e11e7f7630ddc4f0f831a42ba4c12 ("mon/MonMap: add weight to mon_info_t") will not be backported --- diff --git a/src/mon/MonMap.cc b/src/mon/MonMap.cc index f03193e044dd..687c3f869106 100644 --- a/src/mon/MonMap.cc +++ b/src/mon/MonMap.cc @@ -491,7 +491,7 @@ int MonMap::init_with_hosts(const std::string& hostlist, vector addrs; bool success = parse_ip_port_vec( hosts, addrs, - for_mkfs ? entity_addr_t::TYPE_MSGR2 : entity_addr_t::TYPE_ANY); + entity_addr_t::TYPE_ANY); free(hosts); if (!success) return -EINVAL; @@ -504,8 +504,10 @@ int MonMap::init_with_hosts(const std::string& hostlist, string name = prefix; name += n; if (addrs[i].v.size() == 1) { - _add_ambiguous_addr(name, addrs[i].front(), 0); + _add_ambiguous_addr(name, addrs[i].front(), 0, for_mkfs); } else { + // they specified an addrvec, so let's assume they also specified + // the addr *type* and *port*. (we could possibly improve this?) add(name, addrs[i], 0); } }