mirror of
https://github.com/ceph/ceph
synced 2025-04-01 14:51:13 +00:00
osd: add peer_socket_addr to Session
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
388b82f461
commit
7ebdbb7672
@ -5159,9 +5159,8 @@ void OSD::ms_handle_fast_connect(Connection *con)
|
||||
auto priv = con->get_priv();
|
||||
auto s = static_cast<Session*>(priv.get());
|
||||
if (!s) {
|
||||
s = new Session{cct};
|
||||
s = new Session{cct, con};
|
||||
con->set_priv(RefCountedPtr{s, false});
|
||||
s->con = con;
|
||||
dout(10) << " new session (outgoing) " << s << " con=" << s->con
|
||||
<< " addr=" << s->con->get_peer_addr() << dendl;
|
||||
// we don't connect to clients
|
||||
@ -5178,9 +5177,8 @@ void OSD::ms_handle_fast_accept(Connection *con)
|
||||
auto priv = con->get_priv();
|
||||
auto s = static_cast<Session*>(priv.get());
|
||||
if (!s) {
|
||||
s = new Session{cct};
|
||||
s = new Session{cct, con};
|
||||
con->set_priv(RefCountedPtr{s, false});
|
||||
s->con = con;
|
||||
dout(10) << "new session (incoming)" << s << " con=" << con
|
||||
<< " addr=" << con->get_peer_addr()
|
||||
<< " must have raced with connect" << dendl;
|
||||
@ -6625,9 +6623,8 @@ bool OSD::ms_verify_authorizer(
|
||||
auto priv = con->get_priv();
|
||||
auto s = static_cast<Session*>(priv.get());
|
||||
if (!s) {
|
||||
s = new Session{cct};
|
||||
s = new Session{cct, con};
|
||||
con->set_priv(RefCountedPtr{s, false});
|
||||
s->con = con;
|
||||
dout(10) << " new session " << s << " con=" << s->con
|
||||
<< " addr=" << con->get_peer_addr() << dendl;
|
||||
}
|
||||
|
@ -132,6 +132,7 @@ struct Session : public RefCountedObject {
|
||||
OSDCap caps;
|
||||
int64_t auid;
|
||||
ConnectionRef con;
|
||||
entity_addr_t socket_addr;
|
||||
WatchConState wstate;
|
||||
|
||||
Mutex session_dispatch_lock;
|
||||
@ -149,15 +150,20 @@ struct Session : public RefCountedObject {
|
||||
|
||||
std::atomic<uint64_t> backoff_seq = {0};
|
||||
|
||||
explicit Session(CephContext *cct) :
|
||||
explicit Session(CephContext *cct, Connection *con_) :
|
||||
RefCountedObject(cct),
|
||||
auid(-1), con(0),
|
||||
auid(-1), con(con_),
|
||||
socket_addr(con_->get_peer_socket_addr()),
|
||||
wstate(cct),
|
||||
session_dispatch_lock("Session::session_dispatch_lock"),
|
||||
last_sent_epoch(0), received_map_epoch(0),
|
||||
backoff_lock("Session::backoff_lock")
|
||||
{}
|
||||
|
||||
entity_addr_t& get_peer_socket_addr() {
|
||||
return socket_addr;
|
||||
}
|
||||
|
||||
void ack_backoff(
|
||||
CephContext *cct,
|
||||
spg_t pgid,
|
||||
|
Loading…
Reference in New Issue
Block a user