]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: Don't keep sending SESSION_REQUEST_OPEN
authorSam Lang <sam.lang@inktank.com>
Fri, 5 Oct 2012 15:51:00 +0000 (10:51 -0500)
committerSam Lang <sam.lang@inktank.com>
Fri, 5 Oct 2012 15:54:54 +0000 (10:54 -0500)
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 <sam.lang@inktank.com>
src/client/Client.cc

index 3c10f72be5faff4d9392c4452e7e5609136aeabe..43abe4b7c3b844cf25b5ccc761eb9d06826f0d4d 100644 (file)
@@ -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<int>::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];