diff options
author | Benety Goh <benety@mongodb.com> | 2018-12-20 15:58:18 -0500 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2018-12-20 15:58:18 -0500 |
commit | a38bfed6f6347d7a1d8b4a96ad03a1581584a801 (patch) | |
tree | 91452d06d815ec340d8b8e77364eef6ada81781a /src/mongo/db | |
parent | 311f158a3f657fc1810437e72daa8d9428dd991c (diff) | |
download | mongo-a38bfed6f6347d7a1d8b4a96ad03a1581584a801.tar.gz |
Revert "SERVER-36416 Add dropConnections administrative command"
This reverts commit 9163a2cf69c8c2b66f67ff3b95859727101c0dc3.
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/auth/action_types.txt | 2 | ||||
-rw-r--r-- | src/mongo/db/auth/role_graph_builtin_roles.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/commands/SConscript | 2 | ||||
-rw-r--r-- | src/mongo/db/commands/drop_connections.idl | 45 | ||||
-rw-r--r-- | src/mongo/db/commands/drop_connections_command.cpp | 97 |
5 files changed, 1 insertions, 146 deletions
diff --git a/src/mongo/db/auth/action_types.txt b/src/mongo/db/auth/action_types.txt index 303022bf3a9..644f60e3928 100644 --- a/src/mongo/db/auth/action_types.txt +++ b/src/mongo/db/auth/action_types.txt @@ -39,7 +39,6 @@ "dropAllRolesFromDatabase", # Not used for permissions checks, but to id the event in logs. "dropAllUsersFromDatabase", # Not used for permissions checks, but to id the event in logs. "dropCollection", -"dropConnections", "dropDatabase", "dropIndex", "dropRole", @@ -123,3 +122,4 @@ "validate", "viewRole", "viewUser"] + diff --git a/src/mongo/db/auth/role_graph_builtin_roles.cpp b/src/mongo/db/auth/role_graph_builtin_roles.cpp index dd8bb4a8a15..3de5d8b2e53 100644 --- a/src/mongo/db/auth/role_graph_builtin_roles.cpp +++ b/src/mongo/db/auth/role_graph_builtin_roles.cpp @@ -209,7 +209,6 @@ MONGO_INITIALIZER(AuthorizationBuiltinRoles)(InitializerContext* context) { << ActionType::applicationMessage // clusterManager gets this also << ActionType::connPoolSync << ActionType::cpuProfiler - << ActionType::dropConnections << ActionType::logRotate << ActionType::setParameter << ActionType::shutdown diff --git a/src/mongo/db/commands/SConscript b/src/mongo/db/commands/SConscript index 14547d299ab..eabb2df44fa 100644 --- a/src/mongo/db/commands/SConscript +++ b/src/mongo/db/commands/SConscript @@ -134,8 +134,6 @@ env.Library( "conn_pool_stats.cpp", "conn_pool_sync.cpp", "connection_status.cpp", - "drop_connections_command.cpp", - env.Idlc('drop_connections.idl')[0], "generic_servers.cpp", "isself.cpp", "mr_common.cpp", diff --git a/src/mongo/db/commands/drop_connections.idl b/src/mongo/db/commands/drop_connections.idl deleted file mode 100644 index 7d41e108889..00000000000 --- a/src/mongo/db/commands/drop_connections.idl +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (C) 2018-present MongoDB, Inc. -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the Server Side Public License, version 1, -# as published by MongoDB, Inc. -# -# 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 -# Server Side Public License for more details. -# -# You should have received a copy of the Server Side Public License -# along with this program. If not, see -# <http://www.mongodb.com/licensing/server-side-public-license>. -# -# 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 Server Side 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. -# - -# dropConnections IDL File. - -global: - cpp_namespace: "mongo" - -imports: - - "mongo/idl/basic_types.idl" - - "mongo/util/net/hostandport.idl" - -commands: - dropConnections: - description: "An administrative command which takes a list of host and ports and drops pooled connections to them" - namespace: ignored - fields: - hostAndPort: - description: "List of host and ports" - type: array<HostAndPort> diff --git a/src/mongo/db/commands/drop_connections_command.cpp b/src/mongo/db/commands/drop_connections_command.cpp deleted file mode 100644 index 22d5aeffd5e..00000000000 --- a/src/mongo/db/commands/drop_connections_command.cpp +++ /dev/null @@ -1,97 +0,0 @@ - -/** - * Copyright (C) 2018-present MongoDB, Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the Server Side Public License, version 1, - * as published by MongoDB, Inc. - * - * 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 - * Server Side Public License for more details. - * - * You should have received a copy of the Server Side Public License - * along with this program. If not, see - * <http://www.mongodb.com/licensing/server-side-public-license>. - * - * 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 Server Side 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::kCommand - -#include "mongo/platform/basic.h" - -#include "mongo/db/auth/authorization_session.h" -#include "mongo/db/commands.h" -#include "mongo/db/commands/drop_connections_gen.h" -#include "mongo/executor/egress_tag_closer_manager.h" -#include "mongo/util/log.h" -#include "mongo/util/net/hostandport.h" - -namespace mongo { -namespace { - -class DropConnectionsCmd final : public TypedCommand<DropConnectionsCmd> { -public: - using Request = DropConnections; - - std::string help() const override { - return "Drop egress connections to specified host and port"; - } - - bool adminOnly() const override { - return false; - } - - AllowedOnSecondary secondaryAllowed(ServiceContext*) const override { - return AllowedOnSecondary::kAlways; - } - - class Invocation final : public InvocationBase { - public: - using InvocationBase::InvocationBase; - - void typedRun(OperationContext* opCtx) { - - const auto& hostAndPorts = request().getHostAndPort(); - - auto& egressTagCloserManager = - executor::EgressTagCloserManager::get(opCtx->getServiceContext()); - - for (const auto& hostAndPort : hostAndPorts) { - egressTagCloserManager.dropConnections(hostAndPort); - } - } - - NamespaceString ns() const override { - return NamespaceString(); - } - - bool supportsWriteConcern() const override { - return false; - } - - void doCheckAuthorization(OperationContext* opCtx) const override { - uassert(ErrorCodes::Unauthorized, - "Unauthorized", - AuthorizationSession::get(opCtx->getClient()) - ->isAuthorizedForActionsOnResource(ResourcePattern::forClusterResource(), - ActionType::dropConnections)); - } - }; - -} dropConnectionsCmd; - -} // namespace -} // namespace mongo |