From: Sage Weil Date: Fri, 27 Sep 2019 00:28:51 +0000 (-0500) Subject: Merge PR #30223 into master X-Git-Tag: v15.1.0~1415 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=239c8e8564984c71ee385f51508c9bd6eec43853;p=ceph-ci.git Merge PR #30223 into master * refs/pull/30223/head: msg/async: do not register lossy client connections msg/async: allow anonymous client-side connections Reviewed-by: Greg Farnum --- 239c8e8564984c71ee385f51508c9bd6eec43853 diff --cc src/msg/Connection.h index 95f89fd19b8,927e045bce7..1532ce04919 --- a/src/msg/Connection.h +++ b/src/msg/Connection.h @@@ -48,13 -50,14 +48,14 @@@ struct Connection : public RefCountedOb int64_t peer_id = -1; // [msgr2 only] the 0 of osd.0, 4567 or client.4567 safe_item_history peer_addrs; utime_t last_keepalive, last_keepalive_ack; + bool anon = false; ///< anonymous outgoing connection private: - uint64_t features; + uint64_t features = 0; public: - bool is_loopback; - bool failed; // true if we are a lossy connection that has failed. + bool is_loopback = false; + bool failed = false; // true if we are a lossy connection that has failed. - int rx_buffers_version; + int rx_buffers_version = 0; std::map> rx_buffers; // authentication state diff --cc src/msg/async/AsyncMessenger.cc index 3556c4960f5,362068caaea..514284b61a8 --- a/src/msg/async/AsyncMessenger.cc +++ b/src/msg/async/AsyncMessenger.cc @@@ -585,13 -585,18 +585,18 @@@ AsyncConnectionRef AsyncMessenger::crea // create connection Worker *w = stack->get_worker(); - AsyncConnectionRef conn = new AsyncConnection(cct, this, &dispatch_queue, w, + auto conn = ceph::make_ref(cct, this, &dispatch_queue, w, target.is_msgr2(), false); + conn->anon = anon; conn->connect(addrs, type, target); - ceph_assert(!conns.count(addrs)); - ldout(cct, 10) << __func__ << " " << conn << " " << addrs << " " - << *conn->peer_addrs << dendl; - conns[addrs] = conn; + if (anon) { + anon_conns.insert(conn); + } else { + ceph_assert(!conns.count(addrs)); + ldout(cct, 10) << __func__ << " " << conn << " " << addrs << " " + << *conn->peer_addrs << dendl; + conns[addrs] = conn; + } w->get_perf_counter()->inc(l_msgr_active_connections); return conn;