]> 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>
Mon, 18 Apr 2022 02:18:31 +0000 (10:18 +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>
src/client/Client.cc
src/client/Client.h
src/common/options/mds-client.yaml.in

index 9651509686d031464e829e9b35d8681aeadcaf4f..5ca4f428ef41ef7895b921e7ffa2a1f61ac906d1 100644 (file)
@@ -378,6 +378,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;
 
@@ -15949,6 +15952,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 85e5c5be984ac9e12e91a143c94d0751d10915c4..d888e74d9dd6eee2fe34212578351ac34062623c 100644 (file)
@@ -897,6 +897,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