From: Prashant D Date: Fri, 12 Nov 2021 13:44:27 +0000 (+0000) Subject: mon/OSDMonitor: Raise health warning for filestore osds X-Git-Tag: v17.1.0~82^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=39f5a61a3a8a00c7a1a99ecfafafb9fe64a16bd7;p=ceph.git mon/OSDMonitor: Raise health warning for filestore osds Filestore will be deprecated in Quincy, considering that BlueStore has been the default objectstore for quite some time. Fixes: https://tracker.ceph.com/issues/49275 Signed-off-by: Prashant D --- diff --git a/PendingReleaseNotes b/PendingReleaseNotes index da2de5ed8d17..06b0f03de7dc 100644 --- a/PendingReleaseNotes +++ b/PendingReleaseNotes @@ -1,5 +1,8 @@ >=17.0.0 +* Filestore has been deprecated in Quincy, considering that BlueStore has been + the default objectstore for quite some time. + * Critical bug in OMAP format upgrade is fixed. This could cause data corruption (improperly formatted OMAP keys) after pre-Pacific cluster upgrade if bluestore-quick-fix-on-mount parameter is set to true or ceph-bluestore-tool's diff --git a/qa/tasks/ceph.conf.template b/qa/tasks/ceph.conf.template index b6dc391ba058..a6dcf4d342f2 100644 --- a/qa/tasks/ceph.conf.template +++ b/qa/tasks/ceph.conf.template @@ -102,6 +102,8 @@ # 1m isn't quite enough mon_down_mkfs_grace = 2m + mon_warn_on_filestore_osds = false + [client] rgw cache enabled = true rgw enable ops log = true diff --git a/src/common/options/mon.yaml.in b/src/common/options/mon.yaml.in index 8754f4fb6b80..8932fa3e293e 100644 --- a/src/common/options/mon.yaml.in +++ b/src/common/options/mon.yaml.in @@ -290,6 +290,12 @@ options: desc: log health detail to cluster log default: true with_legacy: true +- name: mon_warn_on_filestore_osds + type: bool + level: dev + desc: log health warn for filestore OSDs + default: true + with_legacy: true - name: mon_health_max_detail type: uint level: advanced diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index e8856a5d120f..54f5c54c31ff 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -931,6 +931,9 @@ int Monitor::init() mgr_messenger->add_dispatcher_tail(this); // for auth ms_* calls mgrmon()->prime_mgr_client(); + // generate list of filestore OSDs + osdmon()->get_filestore_osd_list(); + state = STATE_PROBING; bootstrap(); // add features of myself into feature_map diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index a35d0137862e..b1b244975d37 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -2020,12 +2020,26 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t) // metadata, too! for (map::iterator p = pending_metadata.begin(); p != pending_metadata.end(); - ++p) + ++p) { + Metadata m; + auto mp = p->second.cbegin(); + decode(m, mp); + auto it = m.find("osd_objectstore"); + if (it != m.end()) { + if (it->second == "filestore") { + filestore_osds.insert(p->first); + } else { + filestore_osds.erase(p->first); + } + } t->put(OSD_METADATA_PREFIX, stringify(p->first), p->second); + } for (set::iterator p = pending_metadata_rm.begin(); p != pending_metadata_rm.end(); - ++p) + ++p) { + filestore_osds.erase(*p); t->erase(OSD_METADATA_PREFIX, stringify(*p)); + } pending_metadata.clear(); pending_metadata_rm.clear(); @@ -2058,6 +2072,8 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t) // health health_check_map_t next; tmp.check_health(cct, &next); + // OSD_FILESTORE + check_for_filestore_osds(&next); encode_health(next, t); } @@ -2133,6 +2149,37 @@ int OSDMonitor::get_osd_objectstore_type(int osd, string *type) return 0; } +void OSDMonitor::get_filestore_osd_list() +{ + for (unsigned osd = 0; osd < osdmap.get_num_osds(); ++osd) { + string objectstore_type; + int r = get_osd_objectstore_type(osd, &objectstore_type); + if (r == 0 && objectstore_type == "filestore") { + filestore_osds.insert(osd); + } + } +} + +void OSDMonitor::check_for_filestore_osds(health_check_map_t *checks) +{ + if (g_conf()->mon_warn_on_filestore_osds && + filestore_osds.size() > 0) { + ostringstream ss, deprecated_tip; + list detail; + ss << filestore_osds.size() + << " osd(s) " + << (filestore_osds.size() == 1 ? "is" : "are") + << " running Filestore"; + deprecated_tip << ss.str(); + ss << " [Deprecated]"; + auto& d = checks->add("OSD_FILESTORE", HEALTH_WARN, ss.str(), + filestore_osds.size()); + deprecated_tip << ", which has been deprecated."; + detail.push_back(deprecated_tip.str()); + d.detail.swap(detail); + } +} + bool OSDMonitor::is_pool_currently_all_bluestore(int64_t pool_id, const pg_pool_t &pool, ostream *err) diff --git a/src/mon/OSDMonitor.h b/src/mon/OSDMonitor.h index aa789e2e2625..a3bb1732ef37 100644 --- a/src/mon/OSDMonitor.h +++ b/src/mon/OSDMonitor.h @@ -222,6 +222,7 @@ public: ceph::mutex balancer_lock = ceph::make_mutex("OSDMonitor::balancer_lock"); std::map osd_weight; + std::set filestore_osds; using osdmap_key_t = std::pair; using osdmap_cache_t = SimpleLRU *out); void get_versions(std::map> &versions); + void get_filestore_osd_list(); + void check_for_filestore_osds(health_check_map_t *checks); protected: int get_osd_objectstore_type(int osd, std::string *type); bool is_pool_currently_all_bluestore(int64_t pool_id, const pg_pool_t &pool,