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 <sage@redhat.com>
}
std::set<std::string> get_always_on_modules() const {
- auto it = always_on_modules.find(to_integer<uint32_t>(ceph_release()));
- if (it == always_on_modules.end())
- return {};
+ unsigned rnum = to_integer<uint32_t>(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;
}