From: Xiubo Li Date: Mon, 14 Mar 2022 06:29:34 +0000 (+0800) Subject: client: add option to enable and force collecting and sending metrics X-Git-Tag: v18.0.0~1010^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=beb9f1648101bd18f3619c9fc7e972fab34dfc85;p=ceph.git 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 --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 9651509686d03..5ca4f428ef41e 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 85e5c5be984ac..d888e74d9dd6e 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 403e009752703..1881130f8316f 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