From 9bfd5bd322fab60758b2d860b8467323174da4e5 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 9 Jan 2019 16:04:11 -0600 Subject: [PATCH] Revert "mon/MonMap: no noname- mon name prefix when for_mkfs" This reverts commit c078c810313ece647db6d9056c0eca5256a91a34. # Conflicts: # src/mon/MonMap.cc The ceph_mon.cc bootstrap code expects a noname- prefix to identify which unamed mons (i.e., generated from mon_host) in the initial monmap can be taken over as itself. At the same time, the mon recovery code needs a way to know how to name the monitors. Signed-off-by: Sage Weil --- src/mon/MonMap.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/mon/MonMap.cc b/src/mon/MonMap.cc index 50ad0403d1773..a7671671c7033 100644 --- a/src/mon/MonMap.cc +++ b/src/mon/MonMap.cc @@ -447,9 +447,7 @@ int MonMap::init_with_ips(const std::string& ips, n[0] = 'a' + i; n[1] = 0; string name; - if (!for_mkfs) { - name = prefix; - } + name = prefix; name += n; _add_ambiguous_addr(name, addrs[i], 0, for_mkfs); } @@ -780,8 +778,6 @@ int MonMap::build_initial(CephContext *cct, bool for_mkfs, ostream& errout) // -m foo? if (const auto mon_host = conf.get_val("mon_host"); !mon_host.empty()) { - // NOTE: the for_mkfs path here is dodgey.. it assumes the mons will be - // named 'a', 'b', 'c'. auto ret = init_with_ips(mon_host, for_mkfs, "noname-"); if (ret == -EINVAL) { ret = init_with_hosts(mon_host, for_mkfs, "noname-"); -- 2.39.5