[SERVER-18854] Manage connected client information via a decoration on the service context Created: 06/Jun/15  Updated: 24/Jul/17  Resolved: 24/Jul/17

Status: Closed
Project: Core Server
Component/s: Networking
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Done Votes: 0
Labels: platforms-re-triaged
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Platform 5 06/26/16
Participants:

 Description   

ClientBasic current caches information about the connected network client by holding an AbstractMessagingPort pointer. This pointer is accessed from a few places in the database layer, notably:

  • src/mongo/db/auth/sasl_commands.cpp
  • src/mongo/db/commands/authentication_commands.cpp
  • src/mongo/db/repl/replset_commands.cpp

This couples the database implementation to details of the network implementation. Additionally, the last instance, in the replication code, makes use of the connection tagging facility, which is currently managed by a global "Ports" object instantiated inside messaging_port.cpp, which is used to implement MessagingPort::closeAllSockets.

Rather than allowing the database layer direct access to the socket types and using globals to track connections, we should create a new connection management facility, and attach it to the service context. The connection management facility would be responsible for providing database Client level access to information about the network (local and remote addresses, X509 names, etc.), and for managing tagging and global actions on connected clients.



 Comments   
Comment by Andrew Morrow (Inactive) [ 24/Jul/17 ]

The work to introduce the TransportLayer has achieved the aims of this ticket.

Comment by Andrew Morrow (Inactive) [ 30/Jun/15 ]

This was a pre-req to database worker threads, which we have cut from 3.2. Kicking out to 3.3 Required.

Comment by Andrew Morrow (Inactive) [ 06/Jun/15 ]

Additionally, the following files use functions like ClientBasic::getIsLocalHostConnection or Client::clientAddress, which are implemented in terms of the AbstractMessagingPort that is currently held by ClientBasic.

  • src/mongo/db/auth/authz_session_external_state_server_common.cpp
  • src/mongo/db/commands.cpp
  • src/mongo/db/clientlistplugin.cpp
  • src/mongo/db/commands/writeback_compatibility_shim.cpp
  • src/mongo/db/dbcommands.cpp
  • src/mongo/db/introspect.cpp
  • src/mongo/db/repl/replication_coordinator_external_state_impl.cpp
  • src/mongo/s/catalog/legacy/catalog_manager_legacy.cpp
  • src/mongo/s/d_state.cpp
  • src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp
Generated at Thu Feb 08 03:48:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.