From: Sridhar Seshasayee Date: Mon, 22 Nov 2021 15:16:02 +0000 (+0530) Subject: osd/OSDMap: Add health warning if 'require-osd-release' != current release X-Git-Tag: v16.2.8~215^2~7 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=655a5304274d0fc700595da9bf7bfa94853f8820;p=ceph.git osd/OSDMap: Add health warning if 'require-osd-release' != current release After all OSDs are upgraded to a new release, generate a health warning if the 'require-osd-release' flag doesn't match the the new release version. This will result in the cluster showing a warning in the health state until the flag is set properly. Fixes: https://tracker.ceph.com/issues/51984 Signed-off-by: Sridhar Seshasayee (cherry picked from commit bd815bd9d6ecdecaab3d2dd9e0f5a18aa795d749) Conflicts: src/osd/OSDMap.cc - Removed checks for non-existent ceph_release_t 'quincy' flag from OSDMap::pending_require_osd_release(). --- diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index 4a74aec575431..c24989329e97c 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -6011,7 +6011,13 @@ void OSDMap::check_health(CephContext *cct, } // OSD_UPGRADE_FINISHED - // none of these (yet) since we don't run until luminous upgrade is done. + if (auto require_release = pending_require_osd_release()) { + ostringstream ss; + ss << "all OSDs are running " << *require_release << " or later but" + << " require_osd_release < " << *require_release; + auto& d = checks->add("OSD_UPGRADE_FINISHED", HEALTH_WARN, ss.str(), 0); + d.detail.push_back(ss.str()); + } // POOL_NEARFULL/BACKFILLFULL/FULL { @@ -6244,3 +6250,21 @@ unsigned OSDMap::get_device_class_flags(int id) const flags = it->second; return flags; } + +std::optional OSDMap::pending_require_osd_release() const +{ + if (HAVE_FEATURE(get_up_osd_features(), SERVER_PACIFIC) && + require_osd_release < ceph_release_t::pacific) { + return "pacific"; + } + if (HAVE_FEATURE(get_up_osd_features(), SERVER_OCTOPUS) && + require_osd_release < ceph_release_t::octopus) { + return "octopus"; + } + if (HAVE_FEATURE(get_up_osd_features(), SERVER_NAUTILUS) && + require_osd_release < ceph_release_t::nautilus) { + return "nautilus"; + } + + return std::nullopt; +} diff --git a/src/osd/OSDMap.h b/src/osd/OSDMap.h index 711badddec066..cfd93a10db119 100644 --- a/src/osd/OSDMap.h +++ b/src/osd/OSDMap.h @@ -1542,6 +1542,7 @@ public: std::ostream *ss) const; float pool_raw_used_rate(int64_t poolid) const; + std::optional pending_require_osd_release() const; }; WRITE_CLASS_ENCODER_FEATURES(OSDMap)