From: Sage Weil Date: Tue, 31 Mar 2020 21:47:54 +0000 (-0500) Subject: mon/MgrMap: use always_on_modules from most recent release X-Git-Tag: v16.1.0~2624^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dc9a28652428225aedced204645440688d20d035;p=ceph.git mon/MgrMap: use always_on_modules from most recent release If our release isn't in the always_on_map, say because you just upgraded, then start with the modules from the last/most recent release. This should be sufficient to allow an upgrade when the mon is still the old release and the mgrmap doesn't tell us what modules we should be enabling. (Arguably, the always_on_modules should be enshrined in the MgrMap itself and not in the mon?) Signed-off-by: Sage Weil --- diff --git a/src/mon/MgrMap.h b/src/mon/MgrMap.h index e0fb172277f3..37be5c3c1c44 100644 --- a/src/mon/MgrMap.h +++ b/src/mon/MgrMap.h @@ -352,9 +352,19 @@ public: } std::set get_always_on_modules() const { - auto it = always_on_modules.find(to_integer(ceph_release())); - if (it == always_on_modules.end()) - return {}; + unsigned rnum = to_integer(ceph_release()); + auto it = always_on_modules.find(rnum); + if (it == always_on_modules.end()) { + // ok, try the most recent release + if (always_on_modules.empty()) { + return {}; // ugh + } + --it; + if (it->first < rnum) { + return it->second; + } + return {}; // wth + } return it->second; }