]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MonClient: fix wait for monmap+config is non-cephx case 24202/head
authorSage Weil <sage@redhat.com>
Thu, 20 Sep 2018 16:52:27 +0000 (11:52 -0500)
committerSage Weil <sage@redhat.com>
Thu, 20 Sep 2018 16:52:27 +0000 (11:52 -0500)
In the auth_none case, we were exiting the get_monmap_and_config() loop
early, before we got a monmap, because the default constructed monmap
did not have the mimic feature.  Make sure we wait for both the monmap
and config.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/MonClient.cc

index 766892f3594995e7953ad1413447767e8990a9d6..356e0cff9237d08a45db6202a5a6790e105d5f1c 100644 (file)
@@ -127,19 +127,20 @@ int MonClient::get_monmap_and_config()
       continue;
     }
     if (r < 0) {
-      goto out_shutdown;
-    }
-    if (!monmap.persistent_features.contains_all(
-         ceph::features::mon::FEATURE_MIMIC)) {
-      ldout(cct,10) << __func__ << " pre-mimic monitor, no config to fetch"
-                   << dendl;
-      r = 0;
       break;
     }
     {
       Mutex::Locker l(monc_lock);
-      while (!got_config && r == 0) {
-       ldout(cct,20) << __func__ << " waiting for config" << dendl;
+      if (monmap.get_epoch() &&
+         !monmap.persistent_features.contains_all(
+           ceph::features::mon::FEATURE_MIMIC)) {
+       ldout(cct,10) << __func__ << " pre-mimic monitor, no config to fetch"
+                     << dendl;
+       r = 0;
+       break;
+      }
+      while ((!got_config || monmap.get_epoch() == 0) && r == 0) {
+       ldout(cct,20) << __func__ << " waiting for monmap|config" << dendl;
        r = map_cond.WaitInterval(monc_lock, interval);
       }
       if (got_config) {