From a067d77c06242aed80ccbf9e6d03b6a054849ffa Mon Sep 17 00:00:00 2001 From: Randolph Tan Date: Thu, 9 Mar 2017 10:54:04 -0500 Subject: Revert "Revert "SERVER-27750 Attach LogicalTimeMetadata to globalConnPool and shardConnectionPool"" This reverts commit 4e2cb91ed1fe8a9a8caead72a7f0bd56b2ba28d1. --- src/mongo/s/sharding_egress_metadata_hook.h | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'src/mongo/s/sharding_egress_metadata_hook.h') diff --git a/src/mongo/s/sharding_egress_metadata_hook.h b/src/mongo/s/sharding_egress_metadata_hook.h index 1c8849dcea3..87442ebe0f3 100644 --- a/src/mongo/s/sharding_egress_metadata_hook.h +++ b/src/mongo/s/sharding_egress_metadata_hook.h @@ -43,23 +43,14 @@ namespace rpc { class ShardingEgressMetadataHook : public rpc::EgressMetadataHook { public: + /** + * Pass true to shardedConnection if the hook is intended for connections with shard versions. + */ + ShardingEgressMetadataHook(bool shardedConnection); virtual ~ShardingEgressMetadataHook() = default; - Status readReplyMetadata(const HostAndPort& replySource, const BSONObj& metadataObj) override; - Status writeRequestMetadata(OperationContext* opCtx, - const HostAndPort& target, - BSONObjBuilder* metadataBob) override; - - // These overloaded methods exist to allow ShardingConnectionHook, which is soon to be - // deprecated, to use the logic in ShardingEgressMetadataHook instead of duplicating the - // logic. ShardingConnectionHook must provide the replySource and target as strings rather than - // HostAndPorts, since DBClientReplicaSet uses the hook before it decides on the actual host to - // contact. - Status readReplyMetadata(const StringData replySource, const BSONObj& metadataObj); - Status writeRequestMetadata(bool shardedConnection, - OperationContext* opCtx, - const StringData target, - BSONObjBuilder* metadataBob); + Status readReplyMetadata(StringData replySource, const BSONObj& metadataObj) override; + Status writeRequestMetadata(OperationContext* opCtx, BSONObjBuilder* metadataBob) override; protected: /** @@ -83,6 +74,9 @@ protected: * metadata in the response object from running a command. */ virtual Status _advanceConfigOptimeFromShard(ShardId shardId, const BSONObj& metadataObj); + +private: + bool _isShardedConnection; }; } // namespace rpc -- cgit v1.2.1