From: Sage Weil Date: Tue, 11 Sep 2018 21:30:27 +0000 (-0500) Subject: mon: kill Session::global_id and use Connection member instead X-Git-Tag: v14.0.1~26^2~22 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e7d1ab2688498fd3ed3593ef9435e05eb4460899;p=ceph.git mon: kill Session::global_id and use Connection member instead Signed-off-by: Sage Weil --- diff --git a/src/mon/AuthMonitor.cc b/src/mon/AuthMonitor.cc index 80b5857948ef..8f497ed443a5 100644 --- a/src/mon/AuthMonitor.cc +++ b/src/mon/AuthMonitor.cc @@ -526,7 +526,7 @@ bool AuthMonitor::prep_auth(MonOpRequestRef op, bool paxos_writable) decode(struct_v, indata); decode(supported, indata); decode(entity_name, indata); - decode(s->global_id, indata); + decode(s->con->peer_global_id, indata); } catch (const buffer::error &e) { dout(10) << "failed to decode initial auth message" << dendl; ret = -EINVAL; @@ -608,9 +608,9 @@ bool AuthMonitor::prep_auth(MonOpRequestRef op, bool paxos_writable) /* assign a new global_id? we assume this should only happen on the first request. If a client tries to send it later, it'll screw up its auth session */ - if (!s->global_id) { - s->global_id = assign_global_id(op, paxos_writable); - if (!s->global_id) { + if (!s->con->peer_global_id) { + s->con->peer_global_id = assign_global_id(op, paxos_writable); + if (!s->con->peer_global_id) { delete s->auth_handler; s->auth_handler = NULL; @@ -648,7 +648,11 @@ bool AuthMonitor::prep_auth(MonOpRequestRef op, bool paxos_writable) } } else { // request - ret = s->auth_handler->handle_request(indata, response_bl, s->global_id, caps_info); + ret = s->auth_handler->handle_request( + indata, + response_bl, + s->con->peer_global_id, + caps_info); } if (ret == -EIO) { wait_for_active(op, new C_RetryMessage(this,op)); @@ -673,7 +677,7 @@ bool AuthMonitor::prep_auth(MonOpRequestRef op, bool paxos_writable) } reply: - reply = new MAuthReply(proto, &response_bl, ret, s->global_id); + reply = new MAuthReply(proto, &response_bl, ret, s->con->peer_global_id); mon->send_reply(op, reply); if (finished) { // always send the latest monmap. diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index c24b8ca436e1..e5c9d895febe 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -4069,7 +4069,7 @@ void Monitor::_ms_dispatch(Message *m) dout(20) << " caps " << s->caps.get_str() << dendl; if ((is_synchronizing() || - (s->global_id == 0 && !exited_quorum.is_zero())) && + (!s->authenticated && !exited_quorum.is_zero())) && !src_is_mon && m->get_type() != CEPH_MSG_PING) { waitlist_or_zap_client(op); diff --git a/src/mon/Session.h b/src/mon/Session.h index d455263ced8a..8d7bbcf2ff13 100644 --- a/src/mon/Session.h +++ b/src/mon/Session.h @@ -51,7 +51,6 @@ struct MonSession : public RefCountedObject { xlist::item item; set routed_request_tids; MonCap caps; - uint64_t global_id = 0; bool authenticated = false; ///< true if auth handshake is complete