From b9971e0eb3490d025c4db1b89342008820176775 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 (cherry picked from commit beb9f1648101bd18f3619c9fc7e972fab34dfc85) --- 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 6231a337bcccc..100940e01393a 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -354,6 +354,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; @@ -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( + "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 c3cfe09eb9b1e..84fc15d3fe879 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -888,6 +888,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 -- 2.39.5