From a53a4a21a0631a4423830edd9b7dda476d7523f5 Mon Sep 17 00:00:00 2001 From: Sam Lang Date: Fri, 5 Oct 2012 10:51:00 -0500 Subject: [PATCH] client: Don't keep sending SESSION_REQUEST_OPEN This fixes a bug where the client keeps resending session open requests to the target mds because the waiting_for_session.count check was incorrectly using the passed in mds number instead of the target. Also output the mds the message is coming from for debugging. Signed-off-by: Sam Lang --- src/client/Client.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 3c10f72be5faf..43abe4b7c3b84 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -1012,14 +1012,13 @@ out: void Client::connect_mds_targets(int mds) { - //this function shouldn't be called unless we lost a connection ldout(cct, 10) << "connect_mds_targets for mds." << mds << dendl; assert(mds_sessions.count(mds)); const MDSMap::mds_info_t& info = mdsmap->get_mds_info(mds); for (set::const_iterator q = info.export_targets.begin(); q != info.export_targets.end(); q++) { - if (mds_sessions.count(*q) == 0 && waiting_for_session.count(mds) == 0) { + if (mds_sessions.count(*q) == 0 && waiting_for_session.count(*q) == 0) { ldout(cct, 10) << "check_mds_sessions opening mds." << mds << " export target mds." << *q << dendl; messenger->send_message(new MClientSession(CEPH_SESSION_REQUEST_OPEN), @@ -1254,8 +1253,8 @@ void Client::_closed_mds_session(int mds, MetaSession *s) void Client::handle_client_session(MClientSession *m) { - ldout(cct, 10) << "handle_client_session " << *m << dendl; int from = m->get_source().num(); + ldout(cct, 10) << "handle_client_session " << *m << " from mds." << from << dendl; MetaSession *mds_session = NULL; if (mds_sessions.count(from)) mds_session = mds_sessions[from]; -- 2.39.5