Skip to content

Commit a423e17

Browse files
committed
client: do not send metrics until the MDS rank is ready
In some cases when there are a lot of clients and these clients have a lots of known requests need to replay too, the metrics requests will be dropped by the MDS because the MDS is still in the clientreplay state, and also the useless metric requests will slow down MDS. Fixes: https://tracker.ceph.com/issues/61523 Signed-off-by: Xiubo Li <[email protected]>
1 parent 553a0c9 commit a423e17

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/client/Client.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6927,6 +6927,13 @@ void Client::collect_and_send_global_metrics() {
69276927
ldout(cct, 20) << __func__ << dendl;
69286928
ceph_assert(ceph_mutex_is_locked_by_me(client_lock));
69296929

6930+
/* Do not send the metrics until the MDS rank is ready */
6931+
if (!mdsmap->is_active((mds_rank_t)0)) {
6932+
ldout(cct, 5) << __func__ << " MDS rank 0 is not ready yet -- not sending metric"
6933+
<< dendl;
6934+
return;
6935+
}
6936+
69306937
if (!have_open_session((mds_rank_t)0)) {
69316938
ldout(cct, 5) << __func__ << ": no session with rank=0 -- not sending metric"
69326939
<< dendl;

0 commit comments

Comments
 (0)