]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: add option to enable and force collecting and sending metrics
authorXiubo Li <xiubli@redhat.com>
Mon, 14 Mar 2022 06:29:34 +0000 (14:29 +0800)
committerXiubo Li <xiubli@redhat.com>
Wed, 1 Jun 2022 08:29:16 +0000 (16:29 +0800)
To be careful to enable this because it may crash the old MDSes while
upgrading.

Fixes: https://tracker.ceph.com/issues/54411
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit beb9f1648101bd18f3619c9fc7e972fab34dfc85)

src/client/Client.cc
src/client/Client.h
src/common/options/mds-client.yaml.in

index 6231a337bccccadc82d32477de576b0a0592323b..100940e01393a901563d6b06801ccb548465bd99 100644 (file)
@@ -354,6 +354,9 @@ Client::Client(Messenger *m, MonClient *mc, Objecter *objecter_)
   fuse_default_permissions = cct->_conf.get_val<bool>(
     "fuse_default_permissions");
 
+  _collect_and_send_global_metrics = cct->_conf.get_val<bool>(
+    "client_collect_and_send_global_metrics");
+
   if (cct->_conf->client_acl_type == "posix_acl")
     acl_type = POSIX_ACL;
 
@@ -15742,6 +15745,10 @@ void Client::handle_conf_change(const ConfigProxy& conf,
   if (changed.count("client_oc_max_dirty_age")) {
     objectcacher->set_max_dirty_age(cct->_conf->client_oc_max_dirty_age);
   }
+  if (changed.count("client_collect_and_send_global_metrics")) {
+    _collect_and_send_global_metrics = cct->_conf.get_val<bool>(
+      "client_collect_and_send_global_metrics");
+  }
 }
 
 void intrusive_ptr_add_ref(Inode *in)
index c3cfe09eb9b1e35e0b37ade26d26460fef2c21b5..84fc15d3fe87968bfac04aa0402b848763e8ac97 100644 (file)
@@ -888,6 +888,7 @@ public:
   std::unique_ptr<MDSMap> mdsmap;
 
   bool fuse_default_permissions;
+  bool _collect_and_send_global_metrics;
 
 protected:
   /* Flags for check_caps() */
index 403e009752703a8454e90666e5d1271da36be0f6..1881130f8316f0abf12d35b7bed2f306cd417561 100644 (file)
@@ -546,3 +546,16 @@ options:
   min: 0
   flags:
   - runtime
+- name: client_collect_and_send_global_metrics
+  type: bool
+  level: advanced
+  desc: to enable and force collecting and sending the global metrics to MDS
+  long_desc: To be careful for this, when connecting to some old ceph clusters
+    it may crash the MDS daemons while upgrading.
+  default: false
+  tags:
+  - client
+  services:
+  - mds_client
+  flags:
+  - runtime