Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luminous: mds: mds got laggy because of MDSBeacon stuck in mqueue #23556

Merged
merged 1 commit into from Sep 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/mds/Beacon.cc
Expand Up @@ -79,12 +79,24 @@ void Beacon::shutdown()
timer.shutdown();
}

bool Beacon::ms_can_fast_dispatch(const Message *m) const
{
return m->get_type() == MSG_MDS_BEACON;
}

void Beacon::ms_fast_dispatch(Message *m)
{
bool handled = ms_dispatch(m);
assert(handled);
}

bool Beacon::ms_dispatch(Message *m)
{
if (m->get_type() == MSG_MDS_BEACON) {
if (m->get_connection()->get_peer_type() == CEPH_ENTITY_TYPE_MON) {
handle_mds_beacon(static_cast<MMDSBeacon*>(m));
} else {
m->put();
}
return true;
}
Expand Down
3 changes: 3 additions & 0 deletions src/mds/Beacon.h
Expand Up @@ -48,6 +48,9 @@ class Beacon : public Dispatcher
void init(MDSMap const *mdsmap);
void shutdown();

bool ms_can_fast_dispatch_any() const override { return true; }
bool ms_can_fast_dispatch(const Message *m) const override;
void ms_fast_dispatch(Message *m) override;
bool ms_dispatch(Message *m) override;
void ms_handle_connect(Connection *c) override {}
bool ms_handle_reset(Connection *c) override {return false;}
Expand Down