From: Sage Weil Date: Tue, 29 Sep 2015 13:49:50 +0000 (-0400) Subject: mon: always set up session; move waitlist logic X-Git-Tag: v9.1.0~31^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a87582684a74db630ed055834d99425c5a8bee70;p=ceph.git mon: always set up session; move waitlist logic 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 --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 2d4d8d72aec2..e7fb12c5edec 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -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);