From beb9f1648101bd18f3619c9fc7e972fab34dfc85 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Mon, 14 Mar 2022 14:29:34 +0800 Subject: [PATCH] client: add option to enable and force collecting and sending metrics 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 --- src/client/Client.cc | 7 +++++++ src/client/Client.h | 1 + src/common/options/mds-client.yaml.in | 13 +++++++++++++ 3 files changed, 21 insertions(+) diff --git a/src/client/Client.cc b/src/client/Client.cc index 9651509686d..5ca4f428ef4 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -378,6 +378,9 @@ Client::Client(Messenger *m, MonClient *mc, Objecter *objecter_) fuse_default_permissions = cct->_conf.get_val( "fuse_default_permissions"); + _collect_and_send_global_metrics = cct->_conf.get_val( + "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( + "client_collect_and_send_global_metrics"); + } } void intrusive_ptr_add_ref(Inode *in) diff --git a/src/client/Client.h b/src/client/Client.h index 85e5c5be984..d888e74d9dd 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -897,6 +897,7 @@ public: std::unique_ptr mdsmap; bool fuse_default_permissions; + bool _collect_and_send_global_metrics; protected: /* Flags for check_caps() */ diff --git a/src/common/options/mds-client.yaml.in b/src/common/options/mds-client.yaml.in index 403e0097527..1881130f831 100644 --- a/src/common/options/mds-client.yaml.in +++ b/src/common/options/mds-client.yaml.in @@ -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 -- 2.39.5