-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Networking
-
None
-
Fully Compatible
-
Platform 8 08/28/15, Platform 7 08/10/15
As per discussion with kaloian.manassiev, we are going to implement hooking in NetworkInterfaceASIO to facilitate running setShardVersion when we connect to a shard.
class ConnectHookInterface { /** * Runs optional validation logic on an isMaster reply from a remote host. * If a non-OK Status is returned, a the ErrorCode * XXXTemporaryNamePHostValidationFailedXXXTemporaryName will be passed to * the command handler associated with the request that caused this * connection to be created. This will be called once for each new * connection that is established * - even if we have previously connected a host with the same HostAndPort. */ virtual Status validateHost(const HostAndPort&, const BSONObj& isMasterReply) = 0; /** * Generates a command to run on the remote host immediately after * connecting to it. This will be run after socket setup, SSL handshake, * authentication and wire protocol detection occurs. */ virtual RemoteCommandRequest makeRequest(const HostAndPort& remote) = 0; /** * Handles the server's reply to the command generated with makeCommand. */ virtual Status handleReply(StatusWith<RemoteCommandResponse>&& reply) = 0; }; /** * Sets a connect hook for this NetworkInterface. This method can only be * called once, and must be called before startup() - otherwise the result * is undefined. */ void NetworkInterfaceASIO::setConnectHook(std::unique_ptr<ConnectionHookInterface> hook);
- depends on
-
SERVER-19343 Inject SocketFactory in to NetworkInterfaceASIO
- Closed
- is depended on by
-
SERVER-19439 Implement connect hook interface in NetworkInterfaceImpl and NetworkInterfaceMock
- Closed
- is related to
-
SERVER-20033 Add ShardingNetworkConnectionHook to NetworkInterfaceASIO
- Closed