From f35e10f4849440f0583d021e23a83563dd3b1607 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 20 Sep 2018 11:52:27 -0500 Subject: [PATCH] mon/MonClient: fix wait for monmap+config is non-cephx case 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 --- src/mon/MonClient.cc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/mon/MonClient.cc b/src/mon/MonClient.cc index 766892f359499..356e0cff9237d 100644 --- a/src/mon/MonClient.cc +++ b/src/mon/MonClient.cc @@ -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) { -- 2.39.5