]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: always set up session; move waitlist logic
authorSage Weil <sage@redhat.com>
Tue, 29 Sep 2015 13:49:50 +0000 (09:49 -0400)
committerSage Weil <sage@redhat.com>
Mon, 5 Oct 2015 12:37:49 +0000 (08:37 -0400)
Unconditionally attach a Session, so that when we push an op back through
dispatch_op it isn't in a weird broken state.

Move the waitinglist check to the bottom.  Use s->global_id == 0 to tell
whether a client has authenticated, and zap sessions based on that.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/Monitor.cc

index 2d4d8d72aec2e87632e57c2f2850da01aecff213..e7fb12c5edec7dbc9155316aab82082b94938fff 100644 (file)
@@ -3393,6 +3393,7 @@ void Monitor::waitlist_or_zap_client(MonOpRequestRef op)
    * circumstances.
    */
   Message *m = op->get_req();
+  MonSession *s = op->get_session();
   ConnectionRef con = op->get_connection();
   utime_t too_old = ceph_clock_now(g_ceph_context);
   too_old -= g_ceph_context->_conf->mon_lease;
@@ -3404,6 +3405,7 @@ void Monitor::waitlist_or_zap_client(MonOpRequestRef op)
   } else {
     dout(5) << "discarding message " << *m << " and sending client elsewhere" << dendl;
     con->mark_down();
+    remove_session(s);
     op->mark_zap();
   }
 }
@@ -3452,11 +3454,6 @@ void Monitor::_ms_dispatch(Message *m)
       return;
     }
 
-    if (!exited_quorum.is_zero() && !src_is_mon) {
-      waitlist_or_zap_client(op);
-      return;
-    }
-
     dout(10) << "do not have session, making new one" << dendl;
     s = session_map.new_session(m->get_source_inst(), m->get_connection().get());
     assert(s);
@@ -3493,7 +3490,9 @@ void Monitor::_ms_dispatch(Message *m)
   }
   dout(20) << " caps " << s->caps.get_str() << dendl;
 
-  if (is_synchronizing() && !src_is_mon) {
+  if ((is_synchronizing() ||
+       (s->global_id == 0 && !exited_quorum.is_zero())) &&
+      !src_is_mon) {
     waitlist_or_zap_client(op);
   } else {
     dispatch_op(op);