]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "mon/MonMap: no noname- mon name prefix when for_mkfs"
authorSage Weil <sage@redhat.com>
Wed, 9 Jan 2019 22:04:11 +0000 (16:04 -0600)
committerSage Weil <sage@redhat.com>
Fri, 11 Jan 2019 01:00:39 +0000 (19:00 -0600)
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 <sage@redhat.com>
src/mon/MonMap.cc

index 50ad0403d1773fd45db01845d5620c6e9f7f7d41..a7671671c7033d80432bc67621cfe752a0f15803 100644 (file)
@@ -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<std::string>("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-");