diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2017-03-01 11:52:42 -0500 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2017-03-01 18:41:01 -0500 |
commit | 605479fd4bb6b31fcc1e495d6bcf55234c0b68a4 (patch) | |
tree | 4d67ead533e83db5bb3db3a09bd8188b237f3cee /src/mongo/s | |
parent | 74720a72751c92bcb363d31c8a016e158771267e (diff) | |
download | mongo-605479fd4bb6b31fcc1e495d6bcf55234c0b68a4.tar.gz |
SERVER-28155 Get rid of the 'serveronly' sharding library
Fold its contents in the mongod-side of sharding.
Diffstat (limited to 'src/mongo/s')
-rw-r--r-- | src/mongo/s/SConscript | 43 | ||||
-rw-r--r-- | src/mongo/s/catalog/sharding_catalog_test_fixture.h | 1 | ||||
-rw-r--r-- | src/mongo/s/client/shard_remote.cpp | 11 | ||||
-rw-r--r-- | src/mongo/s/client/sharding_connection_hook.h | 7 | ||||
-rw-r--r-- | src/mongo/s/client/sharding_connection_hook_for_mongos.cpp | 42 | ||||
-rw-r--r-- | src/mongo/s/client/sharding_connection_hook_for_mongos.h | 44 | ||||
-rw-r--r-- | src/mongo/s/commands/commands_public.cpp | 1 | ||||
-rw-r--r-- | src/mongo/s/config_server_test_fixture.cpp | 2 | ||||
-rw-r--r-- | src/mongo/s/d_state.cpp | 87 | ||||
-rw-r--r-- | src/mongo/s/server.cpp | 10 | ||||
-rw-r--r-- | src/mongo/s/sharding_egress_metadata_hook_for_mongod.cpp | 67 | ||||
-rw-r--r-- | src/mongo/s/sharding_egress_metadata_hook_for_mongod.h | 48 | ||||
-rw-r--r-- | src/mongo/s/sharding_egress_metadata_hook_for_mongos.cpp | 1 | ||||
-rw-r--r-- | src/mongo/s/sharding_egress_metadata_hook_for_mongos.h | 2 | ||||
-rw-r--r-- | src/mongo/s/sharding_mongod_test_fixture.cpp | 6 |
15 files changed, 30 insertions, 342 deletions
diff --git a/src/mongo/s/SConscript b/src/mongo/s/SConscript index ef34405fe0a..ff072e796ea 100644 --- a/src/mongo/s/SConscript +++ b/src/mongo/s/SConscript @@ -32,7 +32,6 @@ env.Library( '$BUILD_DIR/mongo/s/catalog/replset_dist_lock_manager', 'client/sharding_connection_hook', 'coreshard', - 'cluster_last_error_info', ], ) @@ -102,14 +101,13 @@ env.Library( '$BUILD_DIR/mongo/executor/network_test_env', '$BUILD_DIR/mongo/executor/task_executor_pool', '$BUILD_DIR/mongo/executor/thread_pool_task_executor_test_fixture', - '$BUILD_DIR/mongo/rpc/metadata', '$BUILD_DIR/mongo/s/catalog/dist_lock_manager_mock', '$BUILD_DIR/mongo/s/catalog/sharding_catalog_client_impl', '$BUILD_DIR/mongo/s/coreshard', '$BUILD_DIR/mongo/transport/transport_layer_mock', '$BUILD_DIR/mongo/util/clock_source_mock', '$BUILD_DIR/mongo/util/net/message_port_mock', - 'mongoscore', + 'sharding_egress_metadata_hook_for_mongos', ], ) @@ -153,7 +151,6 @@ env.Library( '$BUILD_DIR/mongo/s/catalog/sharding_catalog_client_impl', '$BUILD_DIR/mongo/s/catalog/sharding_catalog_manager_impl', '$BUILD_DIR/mongo/s/coreshard', - '$BUILD_DIR/mongo/s/serveronly', '$BUILD_DIR/mongo/util/clock_source_mock', '$BUILD_DIR/mongo/util/net/message_port_mock', ], @@ -270,10 +267,19 @@ env.Library( LIBDEPS=[ '$BUILD_DIR/mongo/base', '$BUILD_DIR/mongo/client/connection_string', + '$BUILD_DIR/mongo/util/decorable', + ] +) + +env.Library( + target='sharding_egress_metadata_hook_for_mongos', + source=[ + 'sharding_egress_metadata_hook_for_mongos.cpp' + ], + LIBDEPS=[ '$BUILD_DIR/mongo/rpc/metadata', - '$BUILD_DIR/mongo/db/commands/server_status_core', - '$BUILD_DIR/mongo/db/service_context', - '$BUILD_DIR/mongo/db/stats/timer_stats', + 'cluster_last_error_info', + 'coreshard', ] ) @@ -292,7 +298,6 @@ env.Library( 'mongos_options.cpp', 's_only.cpp', 's_sharding_server_status.cpp', - 'sharding_egress_metadata_hook_for_mongos.cpp', 'sharding_uptime_reporter.cpp', 'version_mongos.cpp', ], @@ -302,7 +307,7 @@ env.Library( '$BUILD_DIR/mongo/db/stats/counters', '$BUILD_DIR/mongo/s/query/cluster_query', '$BUILD_DIR/mongo/util/concurrency/task', - 'cluster_last_error_info', + 'sharding_egress_metadata_hook_for_mongos', 'is_mongos', ], ) @@ -338,23 +343,3 @@ env.Library( '$BUILD_DIR/mongo/db/service_context', ], ) - -env.Library( - target='serveronly', - source=[ - 'd_state.cpp', - 'sharding_egress_metadata_hook_for_mongod.cpp', - ], - LIBDEPS=[ - "coreshard", - "local_sharding_info", - "$BUILD_DIR/mongo/db/commands/core", - "$BUILD_DIR/mongo/db/concurrency/lock_manager", - "$BUILD_DIR/mongo/db/query/query", - "$BUILD_DIR/mongo/db/range_deleter", - "$BUILD_DIR/mongo/db/s/metadata", - "$BUILD_DIR/mongo/db/s/sharding", - "$BUILD_DIR/mongo/executor/network_interface_factory", - "$BUILD_DIR/mongo/s/client/shard_local", - ], -) diff --git a/src/mongo/s/catalog/sharding_catalog_test_fixture.h b/src/mongo/s/catalog/sharding_catalog_test_fixture.h index 4c13a0e8dda..f5736de022a 100644 --- a/src/mongo/s/catalog/sharding_catalog_test_fixture.h +++ b/src/mongo/s/catalog/sharding_catalog_test_fixture.h @@ -48,4 +48,5 @@ protected: void expectFindOnConfigSendBSONObjVector(std::vector<BSONObj> obj); }; + } // namespace mongo diff --git a/src/mongo/s/client/shard_remote.cpp b/src/mongo/s/client/shard_remote.cpp index 85e0bc7678b..dea32639d84 100644 --- a/src/mongo/s/client/shard_remote.cpp +++ b/src/mongo/s/client/shard_remote.cpp @@ -274,22 +274,19 @@ StatusWith<Shard::QueryResponse> ShardRemote::_exhaustiveFindOnConfig( return; } - auto& data = dataStatus.getValue(); + const auto& data = dataStatus.getValue(); + if (data.otherFields.metadata.hasField(rpc::kReplSetMetadataFieldName)) { auto replParseStatus = rpc::ReplSetMetadata::readFromMetadata(data.otherFields.metadata); - if (!replParseStatus.isOK()) { status = replParseStatus.getStatus(); response.docs.clear(); return; } - response.opTime = replParseStatus.getValue().getLastOpCommitted(); - - // We return the config opTime that was returned for this particular request, but as - // a safeguard we ensure our global configOpTime is at least as large as it. - invariant(grid.configOpTime() >= response.opTime); + const auto& replSetMetadata = replParseStatus.getValue(); + response.opTime = replSetMetadata.getLastOpCommitted(); } for (const BSONObj& doc : data.documents) { diff --git a/src/mongo/s/client/sharding_connection_hook.h b/src/mongo/s/client/sharding_connection_hook.h index cde5d86123d..02c300b026b 100644 --- a/src/mongo/s/client/sharding_connection_hook.h +++ b/src/mongo/s/client/sharding_connection_hook.h @@ -42,14 +42,13 @@ class DBClientBase; */ class ShardingConnectionHook : public DBConnectionHook { public: + ShardingConnectionHook(bool shardedConnections, + std::unique_ptr<rpc::ShardingEgressMetadataHook> egressHook); + void onCreate(DBClientBase* conn) override; void onDestroy(DBClientBase* conn) override; void onRelease(DBClientBase* conn) override; -protected: - ShardingConnectionHook(bool shardedConnections, - std::unique_ptr<rpc::ShardingEgressMetadataHook> egressHook); - private: bool _shardedConnections; diff --git a/src/mongo/s/client/sharding_connection_hook_for_mongos.cpp b/src/mongo/s/client/sharding_connection_hook_for_mongos.cpp deleted file mode 100644 index ca39c90ab64..00000000000 --- a/src/mongo/s/client/sharding_connection_hook_for_mongos.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Copyright (C) 2016 MongoDB Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * As a special exception, the copyright holders give permission to link the - * code of portions of this program with the OpenSSL library under certain - * conditions as described in each individual source file and distribute - * linked combinations including the program with the OpenSSL library. You - * must comply with the GNU Affero General Public License in all respects for - * all of the code used other than as permitted herein. If you modify file(s) - * with this exception, you may extend this exception to your version of the - * file(s), but you are not obligated to do so. If you do not wish to do so, - * delete this exception statement from your version. If you delete this - * exception statement from all source files in the program, then also delete - * it in the license file. - */ - -#include "mongo/platform/basic.h" - -#include "mongo/s/client/sharding_connection_hook_for_mongos.h" - -#include "mongo/s/sharding_egress_metadata_hook_for_mongos.h" -#include "mongo/stdx/memory.h" - -namespace mongo { - -ShardingConnectionHookForMongos::ShardingConnectionHookForMongos(bool shardedConnections) - : ShardingConnectionHook(shardedConnections, - stdx::make_unique<rpc::ShardingEgressMetadataHookForMongos>()){}; - -} // namespace mongo diff --git a/src/mongo/s/client/sharding_connection_hook_for_mongos.h b/src/mongo/s/client/sharding_connection_hook_for_mongos.h deleted file mode 100644 index bfcaef9972f..00000000000 --- a/src/mongo/s/client/sharding_connection_hook_for_mongos.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (C) 2016 MongoDB Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * As a special exception, the copyright holders give permission to link the - * code of portions of this program with the OpenSSL library under certain - * conditions as described in each individual source file and distribute - * linked combinations including the program with the OpenSSL library. You - * must comply with the GNU Affero General Public License in all respects for - * all of the code used other than as permitted herein. If you modify file(s) - * with this exception, you may extend this exception to your version of the - * file(s), but you are not obligated to do so. If you do not wish to do so, - * delete this exception statement from your version. If you delete this - * exception statement from all source files in the program, then also delete - * it in the license file. - */ - -#pragma once - -#include "mongo/s/client/sharding_connection_hook.h" - -namespace mongo { - -/** - * Intercepts creation of sharded connections and transparently performs the internal - * authentication on them. - */ -class ShardingConnectionHookForMongos final : public ShardingConnectionHook { -public: - explicit ShardingConnectionHookForMongos(bool shardedConnections); -}; - -} // namespace mongo diff --git a/src/mongo/s/commands/commands_public.cpp b/src/mongo/s/commands/commands_public.cpp index d89da63cd0d..ed43e166fa8 100644 --- a/src/mongo/s/commands/commands_public.cpp +++ b/src/mongo/s/commands/commands_public.cpp @@ -57,7 +57,6 @@ #include "mongo/s/chunk_manager.h" #include "mongo/s/client/shard_connection.h" #include "mongo/s/client/shard_registry.h" -#include "mongo/s/cluster_last_error_info.h" #include "mongo/s/commands/cluster_commands_common.h" #include "mongo/s/commands/cluster_explain.h" #include "mongo/s/commands/run_on_all_shards_cmd.h" diff --git a/src/mongo/s/config_server_test_fixture.cpp b/src/mongo/s/config_server_test_fixture.cpp index 13c45ff9f56..65e8dec3fe8 100644 --- a/src/mongo/s/config_server_test_fixture.cpp +++ b/src/mongo/s/config_server_test_fixture.cpp @@ -69,7 +69,6 @@ #include "mongo/s/grid.h" #include "mongo/s/query/cluster_cursor_manager.h" #include "mongo/s/set_shard_version_request.h" -#include "mongo/s/sharding_egress_metadata_hook_for_mongod.h" #include "mongo/s/write_ops/batched_command_request.h" #include "mongo/s/write_ops/batched_command_response.h" #include "mongo/stdx/memory.h" @@ -82,7 +81,6 @@ using executor::NetworkInterfaceMock; using executor::NetworkTestEnv; using executor::RemoteCommandRequest; using executor::RemoteCommandResponse; -using rpc::ShardingEgressMetadataHookForMongod; using unittest::assertGet; using std::string; diff --git a/src/mongo/s/d_state.cpp b/src/mongo/s/d_state.cpp deleted file mode 100644 index 41960a35ba0..00000000000 --- a/src/mongo/s/d_state.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Copyright (C) 2008-2015 MongoDB Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * As a special exception, the copyright holders give permission to link the - * code of portions of this program with the OpenSSL library under certain - * conditions as described in each individual source file and distribute - * linked combinations including the program with the OpenSSL library. You - * must comply with the GNU Affero General Public License in all respects - * for all of the code used other than as permitted herein. If you modify - * file(s) with this exception, you may extend this exception to your - * version of the file(s), but you are not obligated to do so. If you do not - * wish to do so, delete this exception statement from your version. If you - * delete this exception statement from all source files in the program, - * then also delete it in the license file. - */ - -#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kSharding - -#include "mongo/platform/basic.h" - -#include "mongo/base/init.h" -#include "mongo/db/auth/action_set.h" -#include "mongo/db/auth/action_type.h" -#include "mongo/db/auth/authorization_manager.h" -#include "mongo/db/auth/authorization_session.h" -#include "mongo/db/auth/privilege.h" -#include "mongo/db/commands.h" -#include "mongo/db/db_raii.h" -#include "mongo/db/jsobj.h" -#include "mongo/db/operation_context.h" -#include "mongo/db/s/collection_metadata.h" -#include "mongo/db/s/collection_sharding_state.h" -#include "mongo/db/s/operation_sharding_state.h" -#include "mongo/db/s/sharded_connection_info.h" -#include "mongo/db/s/sharding_state.h" -#include "mongo/db/service_context.h" -#include "mongo/s/local_sharding_info.h" -#include "mongo/util/log.h" -#include "mongo/util/stringutils.h" - -namespace mongo { - -using std::shared_ptr; -using std::string; -using std::stringstream; - -namespace { - -bool haveLocalShardingInfo(OperationContext* txn, const string& ns) { - if (!ShardingState::get(txn)->enabled()) { - return false; - } - - const auto& oss = OperationShardingState::get(txn); - if (oss.hasShardVersion()) { - return true; - } - - const auto& sci = ShardedConnectionInfo::get(txn->getClient(), false); - if (sci && !sci->getVersion(ns).isStrictlyEqualTo(ChunkVersion::UNSHARDED())) { - return true; - } - - return false; -} - -MONGO_INITIALIZER_WITH_PREREQUISITES(MongoDLocalShardingInfo, ("SetGlobalEnvironment")) -(InitializerContext* context) { - enableLocalShardingInfo(getGlobalServiceContext(), &haveLocalShardingInfo); - return Status::OK(); -} - -} // namespace - -} // namespace mongo diff --git a/src/mongo/s/server.cpp b/src/mongo/s/server.cpp index 61784799c0f..60b46736290 100644 --- a/src/mongo/s/server.cpp +++ b/src/mongo/s/server.cpp @@ -71,7 +71,7 @@ #include "mongo/s/client/shard_factory.h" #include "mongo/s/client/shard_registry.h" #include "mongo/s/client/shard_remote.h" -#include "mongo/s/client/sharding_connection_hook_for_mongos.h" +#include "mongo/s/client/sharding_connection_hook.h" #include "mongo/s/grid.h" #include "mongo/s/is_mongos.h" #include "mongo/s/mongos_options.h" @@ -79,6 +79,7 @@ #include "mongo/s/query/cluster_cursor_manager.h" #include "mongo/s/service_entry_point_mongos.h" #include "mongo/s/sharding_egress_metadata_hook_for_mongos.h" +#include "mongo/s/sharding_egress_metadata_hook_for_mongos.h" #include "mongo/s/sharding_initialization.h" #include "mongo/s/sharding_uptime_reporter.h" #include "mongo/s/version_mongos.h" @@ -255,8 +256,11 @@ static ExitCode runMongosServer() { } // Add sharding hooks to both connection pools - ShardingConnectionHook includes auth hooks - globalConnPool.addHook(new ShardingConnectionHookForMongos(false)); - shardConnectionPool.addHook(new ShardingConnectionHookForMongos(true)); + globalConnPool.addHook(new ShardingConnectionHook( + false, stdx::make_unique<rpc::ShardingEgressMetadataHookForMongos>())); + + shardConnectionPool.addHook(new ShardingConnectionHook( + true, stdx::make_unique<rpc::ShardingEgressMetadataHookForMongos>())); ReplicaSetMonitor::setAsynchronousConfigChangeHook( &ShardRegistry::replicaSetChangeConfigServerUpdateHook); diff --git a/src/mongo/s/sharding_egress_metadata_hook_for_mongod.cpp b/src/mongo/s/sharding_egress_metadata_hook_for_mongod.cpp deleted file mode 100644 index 2c8dc215847..00000000000 --- a/src/mongo/s/sharding_egress_metadata_hook_for_mongod.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright (C) 2016 MongoDB Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * As a special exception, the copyright holders give permission to link the - * code of portions of this program with the OpenSSL library under certain - * conditions as described in each individual source file and distribute - * linked combinations including the program with the OpenSSL library. You - * must comply with the GNU Affero General Public License in all respects for - * all of the code used other than as permitted herein. If you modify file(s) - * with this exception, you may extend this exception to your version of the - * file(s), but you are not obligated to do so. If you do not wish to do so, - * delete this exception statement from your version. If you delete this - * exception statement from all source files in the program, then also delete - * it in the license file. - */ - -#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kSharding - -#include "mongo/platform/basic.h" - -#include "mongo/s/sharding_egress_metadata_hook_for_mongod.h" - -#include "mongo/base/status.h" -#include "mongo/db/repl/replication_coordinator_global.h" -#include "mongo/db/server_options.h" -#include "mongo/s/grid.h" -#include "mongo/s/sharding_egress_metadata_hook_for_mongos.h" - -namespace mongo { - -namespace rpc { - -void ShardingEgressMetadataHookForMongod::_saveGLEStats(const BSONObj& metadata, - StringData hostString) {} - -repl::OpTime ShardingEgressMetadataHookForMongod::_getConfigServerOpTime() { - if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer) { - return repl::getGlobalReplicationCoordinator()->getCurrentCommittedSnapshotOpTime(); - } else { - // TODO uncomment as part of SERVER-22663 - // invariant(serverGlobalParams.clusterRole == ClusterRole::ShardServer); - return grid.configOpTime(); - } -} - -Status ShardingEgressMetadataHookForMongod::_advanceConfigOptimeFromShard( - ShardId shardId, const BSONObj& metadataObj) { - if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer) { - return Status::OK(); - } - return ShardingEgressMetadataHook::_advanceConfigOptimeFromShard(shardId, metadataObj); -} - -} // namespace rpc -} // namespace mongo diff --git a/src/mongo/s/sharding_egress_metadata_hook_for_mongod.h b/src/mongo/s/sharding_egress_metadata_hook_for_mongod.h deleted file mode 100644 index 56272d97cd2..00000000000 --- a/src/mongo/s/sharding_egress_metadata_hook_for_mongod.h +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Copyright (C) 2016 MongoDB Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * As a special exception, the copyright holders give permission to link the - * code of portions of this program with the OpenSSL library under certain - * conditions as described in each individual source file and distribute - * linked combinations including the program with the OpenSSL library. You - * must comply with the GNU Affero General Public License in all respects for - * all of the code used other than as permitted herein. If you modify file(s) - * with this exception, you may extend this exception to your version of the - * file(s), but you are not obligated to do so. If you do not wish to do so, - * delete this exception statement from your version. If you delete this - * exception statement from all source files in the program, then also delete - * it in the license file. - */ - -#pragma once - -#include "mongo/s/sharding_egress_metadata_hook.h" - -namespace mongo { - -namespace rpc { - -class ShardingEgressMetadataHookForMongod final : public ShardingEgressMetadataHook { -public: - ShardingEgressMetadataHookForMongod() = default; - -private: - void _saveGLEStats(const BSONObj& metadata, StringData hostString) override; - repl::OpTime _getConfigServerOpTime() override; - Status _advanceConfigOptimeFromShard(ShardId shardId, const BSONObj& metadataObj) override; -}; - -} // namespace rpc -} // namespace mongo diff --git a/src/mongo/s/sharding_egress_metadata_hook_for_mongos.cpp b/src/mongo/s/sharding_egress_metadata_hook_for_mongos.cpp index 6fdf800548c..f355054f92b 100644 --- a/src/mongo/s/sharding_egress_metadata_hook_for_mongos.cpp +++ b/src/mongo/s/sharding_egress_metadata_hook_for_mongos.cpp @@ -39,7 +39,6 @@ #include "mongo/util/log.h" namespace mongo { - namespace rpc { void ShardingEgressMetadataHookForMongos::_saveGLEStats(const BSONObj& metadata, diff --git a/src/mongo/s/sharding_egress_metadata_hook_for_mongos.h b/src/mongo/s/sharding_egress_metadata_hook_for_mongos.h index 92fd9cf9eef..9cba4226df2 100644 --- a/src/mongo/s/sharding_egress_metadata_hook_for_mongos.h +++ b/src/mongo/s/sharding_egress_metadata_hook_for_mongos.h @@ -31,12 +31,12 @@ #include "mongo/s/sharding_egress_metadata_hook.h" namespace mongo { - namespace rpc { class ShardingEgressMetadataHookForMongos final : public ShardingEgressMetadataHook { private: void _saveGLEStats(const BSONObj& metadata, StringData hostString) override; + repl::OpTime _getConfigServerOpTime() override; }; diff --git a/src/mongo/s/sharding_mongod_test_fixture.cpp b/src/mongo/s/sharding_mongod_test_fixture.cpp index 96694e87e77..53e0fcd62d9 100644 --- a/src/mongo/s/sharding_mongod_test_fixture.cpp +++ b/src/mongo/s/sharding_mongod_test_fixture.cpp @@ -70,7 +70,6 @@ #include "mongo/s/grid.h" #include "mongo/s/query/cluster_cursor_manager.h" #include "mongo/s/set_shard_version_request.h" -#include "mongo/s/sharding_egress_metadata_hook_for_mongod.h" #include "mongo/s/write_ops/batched_command_request.h" #include "mongo/s/write_ops/batched_command_response.h" #include "mongo/stdx/memory.h" @@ -86,7 +85,6 @@ using executor::RemoteCommandResponse; using repl::ReplicationCoordinator; using repl::ReplicationCoordinatorMock; using repl::ReplSettings; -using rpc::ShardingEgressMetadataHookForMongod; using unittest::assertGet; using std::string; @@ -140,8 +138,6 @@ std::unique_ptr<executor::TaskExecutorPool> ShardingMongodTestFixture::makeTaskE // threads, tasks in the NetworkInterfaceMock must be carried out synchronously by the (single) // thread the unit test is running on. auto netForFixedTaskExecutor = stdx::make_unique<executor::NetworkInterfaceMock>(); - netForFixedTaskExecutor->setEgressMetadataHook( - stdx::make_unique<ShardingEgressMetadataHookForMongod>()); _mockNetwork = netForFixedTaskExecutor.get(); // Set up a ThreadPoolTaskExecutor. Note, for local tasks this TaskExecutor uses a @@ -156,8 +152,6 @@ std::unique_ptr<executor::TaskExecutorPool> ShardingMongodTestFixture::makeTaskE // Set up a NetworkInterfaceMock for the (one) arbitrary TaskExecutor that will go in the set // of arbitrary TaskExecutors. auto netForArbitraryExecutor = stdx::make_unique<executor::NetworkInterfaceMock>(); - netForArbitraryExecutor->setEgressMetadataHook( - stdx::make_unique<ShardingEgressMetadataHookForMongod>()); // Set up (one) TaskExecutor for the set of arbitrary TaskExecutors. auto arbitraryExecutorForExecutorPool = |