Commit f7c2f4f6 authored by Xiubo Li's avatar Xiubo Li Committed by Ilya Dryomov

ceph: only send metrics when the MDS rank is ready

When the MDS rank is in clientreplay state, the metrics requests
will be discarded directly. Also, when there are a lot of known
client requests to recover from, the metrics requests will slow
down the MDS rank from getting to the active state sooner.

With this patch, we will send the metrics requests only when the
MDS rank is in active state.

Link: https://tracker.ceph.com/issues/61524Signed-off-by: default avatarXiubo Li <xiubli@redhat.com>
Reviewed-by: default avatarMilind Changire <mchangir@redhat.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 6995e2de
......@@ -36,6 +36,14 @@ static bool ceph_mdsc_send_metrics(struct ceph_mds_client *mdsc,
s32 items = 0;
s32 len;
/* Do not send the metrics until the MDS rank is ready */
mutex_lock(&mdsc->mutex);
if (ceph_mdsmap_get_state(mdsc->mdsmap, s->s_mds) != CEPH_MDS_STATE_ACTIVE) {
mutex_unlock(&mdsc->mutex);
return false;
}
mutex_unlock(&mdsc->mutex);
len = sizeof(*head) + sizeof(*cap) + sizeof(*read) + sizeof(*write)
+ sizeof(*meta) + sizeof(*dlease) + sizeof(*files)
+ sizeof(*icaps) + sizeof(*inodes) + sizeof(*rsize)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment