Skip to content

Commit

Permalink
Merge PR ceph#19234 into master
Browse files Browse the repository at this point in the history
* refs/pull/19234/head:
	mds: handle client session messages when mds is stopping

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
  • Loading branch information
batrick committed Dec 18, 2017
2 parents 213af8b + 559fdca commit a313e6f
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/mds/Server.cc
Expand Up @@ -199,8 +199,7 @@ void Server::dispatch(Message *m)
}

// active?
if (!mds->is_active() &&
!(mds->is_stopping() && m->get_source().is_mds())) {
if (!mds->is_active()) {
if (m->get_type() == CEPH_MSG_CLIENT_REQUEST &&
(mds->is_reconnect() || mds->get_want_state() == CEPH_MDS_STATE_RECONNECT)) {
MClientRequest *req = static_cast<MClientRequest*>(m);
Expand Down Expand Up @@ -237,6 +236,10 @@ void Server::dispatch(Message *m)
if (m->get_type() == MSG_MDS_SLAVE_REQUEST) {
// handle_slave_request() will wait if necessary
wait_for_active = false;
} else if (mds->is_stopping()) {
if (m->get_source().is_mds() ||
m->get_type() == CEPH_MSG_CLIENT_SESSION)
wait_for_active = false;
} else if (mds->is_clientreplay()) {
// session open requests need to be handled during replay,
// close requests need to be delayed
Expand Down Expand Up @@ -349,6 +352,12 @@ void Server::handle_client_session(MClientSession *m)
assert(session->is_closed() ||
session->is_closing());

if (mds->is_stopping()) {
dout(10) << "mds is stopping, dropping open req" << dendl;
m->put();
return;
}

blacklisted = mds->objecter->with_osdmap(
[session](const OSDMap &osd_map) -> bool {
return osd_map.is_blacklisted(session->info.inst.addr);
Expand Down Expand Up @@ -457,7 +466,8 @@ void Server::handle_client_session(MClientSession *m)
break;

case CEPH_SESSION_REQUEST_FLUSH_MDLOG:
mdlog->flush();
if (mds->is_active())
mdlog->flush();
break;

default:
Expand Down

0 comments on commit a313e6f

Please sign in to comment.