]> git-server-git.apps.pok.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, 22 Jun 2022 05:14:11 +0000 (13:14 +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)

 Conflicts:
src/common/options/mds-client.yaml.in

src/client/Client.cc
src/client/Client.h
src/common/options.cc

index 680421da982ffe0ace5b25e871223ff766cead98..32f2fd1cf5c0a4ef0ddf23560f0272252fbca855 100644 (file)
@@ -346,6 +346,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;
 
@@ -15734,6 +15737,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 43263a1cdfadcfe1f5e6f6f957d8e4859d68f39c..304c20b90edd3b91863078f4b8860b7f72ed9f0a 100644 (file)
@@ -889,6 +889,7 @@ public:
   std::unique_ptr<MDSMap> mdsmap;
 
   bool fuse_default_permissions;
+  bool _collect_and_send_global_metrics;
 
 protected:
   /* Flags for check_caps() */
index 06d300b5c2bd6378e453dc2e1f033b3ef3b4351d..528d1a28f61aa066676e847417107c105c9e7c20 100644 (file)
@@ -9211,6 +9211,14 @@ std::vector<Option> get_mds_client_options() {
     .set_min(0)
     .set_description("timeout for shutting down CephFS")
     .set_long_description("Timeout for shutting down CephFS via unmount or shutdown.")
+    .add_tag("client"),
+
+    Option("client_collect_and_send_global_metrics", Option::TYPE_BOOL, Option::LEVEL_ADVANCED)
+    .set_flag(Option::FLAG_RUNTIME)
+    .set_default(false)
+    .set_description("to enable and force collecting and sending the global metrics to MDS")
+    .set_long_description("To be careful for this, when connecting to some old ceph "
+       "clusters it may crash the MDS daemons while upgrading")
     .add_tag("client")
     });
 }