mirror of
https://github.com/ceph/ceph
synced 2025-02-24 19:47:44 +00:00
mds: detect mds-mds messages not of type MMDSOp
* Detect mds-mds messages not of type MMDSOp. * Return true from MetricAggregator::ms_dispatch2 only when the peer is an MDS and the metrics is handled. Fixes: https://tracker.ceph.com/issues/46426 Signed-off-by: Jos Collin <jcollin@redhat.com>
This commit is contained in:
parent
18c1386f1d
commit
05b6cbe908
@ -78,10 +78,14 @@ void MetricAggregator::ms_fast_dispatch2(const ref_t<Message> &m) {
|
||||
}
|
||||
|
||||
bool MetricAggregator::ms_dispatch2(const ref_t<Message> &m) {
|
||||
if (m->get_type() == MSG_MDS_METRICS) {
|
||||
if (m->get_connection()->get_peer_type() == CEPH_ENTITY_TYPE_MDS) {
|
||||
handle_mds_metrics(ref_cast<MMDSMetrics>(m));
|
||||
}
|
||||
if (m->get_type() == MSG_MDS_METRICS &&
|
||||
m->get_connection()->get_peer_type() == CEPH_ENTITY_TYPE_MDS) {
|
||||
const Message *msg = m.get();
|
||||
const MMDSOp *op = dynamic_cast<const MMDSOp*>(msg);
|
||||
if (!op)
|
||||
dout(0) << typeid(*msg).name() << " is not an MMDSOp type" << dendl;
|
||||
ceph_assert(op);
|
||||
handle_mds_metrics(ref_cast<MMDSMetrics>(m));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -34,13 +34,16 @@ bool MetricsHandler::ms_dispatch2(const ref_t<Message> &m) {
|
||||
m->get_connection()->get_peer_type() == CEPH_ENTITY_TYPE_CLIENT) {
|
||||
handle_client_metrics(ref_cast<MClientMetrics>(m));
|
||||
return true;
|
||||
}
|
||||
if (m->get_type() == MSG_MDS_PING &&
|
||||
m->get_connection()->get_peer_type() == CEPH_ENTITY_TYPE_MDS) {
|
||||
} else if (m->get_type() == MSG_MDS_PING &&
|
||||
m->get_connection()->get_peer_type() == CEPH_ENTITY_TYPE_MDS) {
|
||||
const Message *msg = m.get();
|
||||
const MMDSOp *op = dynamic_cast<const MMDSOp*>(msg);
|
||||
if (!op)
|
||||
dout(0) << typeid(*msg).name() << " is not an MMDSOp type" << dendl;
|
||||
ceph_assert(op);
|
||||
handle_mds_ping(ref_cast<MMDSPing>(m));
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user