]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: Raise health warning for filestore osds
authorPrashant D <pdhange@redhat.com>
Fri, 12 Nov 2021 13:44:27 +0000 (13:44 +0000)
committerPrashant D <pdhange@redhat.com>
Wed, 5 Jan 2022 10:08:25 +0000 (10:08 +0000)
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 <pdhange@redhat.com>
PendingReleaseNotes
qa/tasks/ceph.conf.template
src/common/options/mon.yaml.in
src/mon/Monitor.cc
src/mon/OSDMonitor.cc
src/mon/OSDMonitor.h

index da2de5ed8d1754fc7a1948271a9ca56d626badcd..06b0f03de7dcee6fefbd7e38eca4bdf1c4a9461c 100644 (file)
@@ -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
index b6dc391ba058c75f5dff0b59b7f9a214e426e4d8..a6dcf4d342f20fddb670c79323950f937feb5231 100644 (file)
        # 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
index 8754f4fb6b80d13117c13900a83a0db23e712ac4..8932fa3e293ef03d6d13b4ff7b8a9523e40ebfec 100644 (file)
@@ -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
index e8856a5d120f64e7d3294356a38eb41396017097..54f5c54c31ff03e102baf2bd9903d9a8940cc89f 100644 (file)
@@ -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
index a35d0137862e0c8889ee777763a13bf2ca3255ff..b1b244975d374eebe3c12ad81e188f50d0854683 100644 (file)
@@ -2020,12 +2020,26 @@ void OSDMonitor::encode_pending(MonitorDBStore::TransactionRef t)
   // metadata, too!
   for (map<int,bufferlist>::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<int>::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<string> 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)
index aa789e2e26255885e1ec5aa5edd2783796eeb863..a3bb1732ef37f21e4cccb7bf0d49b180e32c3b12 100644 (file)
@@ -222,6 +222,7 @@ public:
   ceph::mutex balancer_lock = ceph::make_mutex("OSDMonitor::balancer_lock");
 
   std::map<int,double> osd_weight;
+  std::set<int32_t> filestore_osds;
 
   using osdmap_key_t = std::pair<version_t, uint64_t>;
   using osdmap_cache_t = SimpleLRU<osdmap_key_t,
@@ -629,6 +630,8 @@ private:
 public:
   void count_metadata(const std::string& field, std::map<std::string,int> *out);
   void get_versions(std::map<std::string, std::list<std::string>> &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,