From b356fd0a8c65b4f6dad9e51286df380e6974f842 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 12 Mar 2021 15:21:49 -0500 Subject: [PATCH] mgr: wait for ~3 beacons on startup if mons are pre-pacific If we are going active and the mons are pre-pacific, they may have the bug https://tracker.ceph.com/issues/49778 which prevents our modules metadata (including options) from being updated (until the next beacon). Wait a bit (6s by default, 3x the 2s mgr_tick_period) to let this happen. This allows us to upgrade from broken pre-pacific mons using cephadm, which may (if orig cluster is <15.2.5) immediately do a cephadm migration that relies on the mgr/cephadm/migration_current config option being present in the mon's mgrmap. Workaround for https://tracker.ceph.com/issues/49778 Signed-off-by: Sage Weil --- src/mgr/Mgr.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mgr/Mgr.cc b/src/mgr/Mgr.cc index fb5f5253275..b8e1ec8e4aa 100644 --- a/src/mgr/Mgr.cc +++ b/src/mgr/Mgr.cc @@ -237,6 +237,15 @@ void Mgr::init() mon_allows_kv_sub = true; } }); + if (!mon_allows_kv_sub) { + // mons are still pre-pacific. wait long enough to ensure our + // next beacon is processed so that our module options are + // propagated. See https://tracker.ceph.com/issues/49778 + lock.unlock(); + dout(10) << "waiting a bit for the pre-pacific mon to process our beacon" << dendl; + sleep(g_conf().get_val("mgr_tick_period").count() * 3); + lock.lock(); + } // subscribe to all the maps monc->sub_want("log-info", 0, 0); -- 2.39.5