]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: do not reset session state on reopened sessions
authorSage Weil <sage@inktank.com>
Sun, 21 Oct 2012 21:54:23 +0000 (14:54 -0700)
committerSage Weil <sage@inktank.com>
Fri, 26 Oct 2012 03:49:04 +0000 (20:49 -0700)
We can have a sequence one the MDS like:

 - queue REQUEST_CLOSE to journal
 - force_open, queue open to journal
 - request_close acked, do nothing
 - force_open acked, send OPEN

In this case, the MDS never actually closed the session, and all of the
state remained valid.  The client, however, gets a suprious OPEN
message and resets the session state.

Fix this by not resetting that state.

A nicer fix might be to not send the second OPEN at all, but that would
require a REOPENING state on the MDS which is more complicated; this is
good enough.  Also, that approach might not give the client an
appropriate opportunity to say "um, no..." and resend the
REQUEST_CLOSE.

Signed-off-by: Sage Weil <sage@inktank.com>
src/client/Client.cc

index b83bfeb4c9ede1a99331547b619b55e620e3c882..de9475f91743c5870d09d589af39192a8e979a87 100644 (file)
@@ -1263,11 +1263,12 @@ void Client::handle_client_session(MClientSession *m)
 
   switch (m->get_op()) {
   case CEPH_SESSION_OPEN:
-    if (!mds_session)
+    if (!mds_session) {
       mds_sessions[from] = mds_session = new MetaSession();
-    mds_session->mds_num = from;
-    mds_session->seq = 0;
-    mds_session->inst = m->get_source_inst();
+      mds_session->mds_num = from;
+      mds_session->seq = 0;
+      mds_session->inst = m->get_source_inst();
+    }
     renew_caps(from);
     if (unmounting) {
       mds_session->closing = true;