summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Zhang <jason.zhang@mongodb.com>2021-01-21 14:41:10 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-02-02 17:40:57 +0000
commitc8b93f2649f3e5b63b4e28c791477935e0e6d3d8 (patch)
tree59d4cb2aa2cec483453709a30af973fa7c25f752
parente0602a389d6a9d842b73fd9b22c9046b046131d7 (diff)
downloadmongo-c8b93f2649f3e5b63b4e28c791477935e0e6d3d8.tar.gz
SERVER-47807 Remove shardConnPoolStats command
-rw-r--r--jstests/core/views/views_all_commands.js1
-rw-r--r--jstests/replsets/db_reads_while_recovering_all_commands.js1
-rw-r--r--jstests/replsets/tenant_migration_concurrent_writes.js1
-rw-r--r--jstests/sharding/database_versioning_all_commands.js1
-rw-r--r--jstests/sharding/libs/mongos_api_params_util.js4
-rw-r--r--jstests/sharding/read_write_concern_defaults_application.js1
-rw-r--r--jstests/sharding/rs_stepdown_and_pooling.js5
-rw-r--r--jstests/sharding/safe_secondary_reads_drop_recreate.js1
-rw-r--r--jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js1
-rw-r--r--jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js1
-rw-r--r--jstests/sharding/shard_kill_and_pooling.js6
-rw-r--r--src/mongo/db/commands/conn_pool_stats.cpp43
12 files changed, 4 insertions, 62 deletions
diff --git a/jstests/core/views/views_all_commands.js b/jstests/core/views/views_all_commands.js
index 8072aed23a1..ac763172eed 100644
--- a/jstests/core/views/views_all_commands.js
+++ b/jstests/core/views/views_all_commands.js
@@ -512,7 +512,6 @@ let viewsCommandTests = {
expectFailure: true,
isAdminCommand: true,
},
- shardConnPoolStats: {skip: isUnrelated},
shardingState: {skip: isUnrelated},
shutdown: {skip: isUnrelated},
sleep: {skip: isUnrelated},
diff --git a/jstests/replsets/db_reads_while_recovering_all_commands.js b/jstests/replsets/db_reads_while_recovering_all_commands.js
index d6e7d545b8d..2fcea41ad33 100644
--- a/jstests/replsets/db_reads_while_recovering_all_commands.js
+++ b/jstests/replsets/db_reads_while_recovering_all_commands.js
@@ -285,7 +285,6 @@ const allCommands = {
setFreeMonitoring: {skip: isPrimaryOnly},
setParameter: {skip: isNotAUserDataRead},
setShardVersion: {skip: isNotAUserDataRead},
- shardConnPoolStats: {skip: isNotAUserDataRead},
shardingState: {skip: isNotAUserDataRead},
shutdown: {skip: isNotAUserDataRead},
sleep: {skip: isNotAUserDataRead},
diff --git a/jstests/replsets/tenant_migration_concurrent_writes.js b/jstests/replsets/tenant_migration_concurrent_writes.js
index f05becc05c5..40a199a2c9d 100644
--- a/jstests/replsets/tenant_migration_concurrent_writes.js
+++ b/jstests/replsets/tenant_migration_concurrent_writes.js
@@ -874,7 +874,6 @@ const testCases = {
setIndexCommitQuorum: {skip: isNotRunOnUserDatabase},
setParameter: {skip: isNotRunOnUserDatabase},
setShardVersion: {skip: isNotRunOnUserDatabase},
- shardConnPoolStats: {skip: isNotRunOnUserDatabase},
shardingState: {skip: isNotRunOnUserDatabase},
shutdown: {skip: isNotRunOnUserDatabase},
sleep: {skip: isNotRunOnUserDatabase},
diff --git a/jstests/sharding/database_versioning_all_commands.js b/jstests/sharding/database_versioning_all_commands.js
index db663f346e7..2474c572502 100644
--- a/jstests/sharding/database_versioning_all_commands.js
+++ b/jstests/sharding/database_versioning_all_commands.js
@@ -620,7 +620,6 @@ let testCases = {
{skip: "explicitly fails for mongos, primary mongod only", conditional: true},
setParameter: {skip: "executes locally on mongos (not sent to any remote node)"},
shardCollection: {skip: "does not forward command to primary shard"},
- shardConnPoolStats: {skip: "does not forward command to primary shard"},
shutdown: {skip: "does not forward command to primary shard"},
split: {skip: "does not forward command to primary shard"},
splitVector: {skip: "does not forward command to primary shard"},
diff --git a/jstests/sharding/libs/mongos_api_params_util.js b/jstests/sharding/libs/mongos_api_params_util.js
index cdd8a4961fb..3741ebd82a7 100644
--- a/jstests/sharding/libs/mongos_api_params_util.js
+++ b/jstests/sharding/libs/mongos_api_params_util.js
@@ -1101,10 +1101,6 @@ let MongosAPIParametersUtil = (function() {
command: () => ({shardCollection: "db.collection", key: {_id: 1}})
}
},
- {
- commandName: "shardConnPoolStats",
- skip: "executes locally on mongos (not sent to any remote node)"
- },
{commandName: "shutdown", skip: "executes locally on mongos (not sent to any remote node)"},
{
commandName: "split",
diff --git a/jstests/sharding/read_write_concern_defaults_application.js b/jstests/sharding/read_write_concern_defaults_application.js
index a7496f2b62e..af1721e2e08 100644
--- a/jstests/sharding/read_write_concern_defaults_application.js
+++ b/jstests/sharding/read_write_concern_defaults_application.js
@@ -605,7 +605,6 @@ let testCases = {
setParameter: {skip: "does not accept read or write concern"},
setShardVersion: {skip: "internal command"},
shardCollection: {skip: "does not accept read or write concern"},
- shardConnPoolStats: {skip: "does not accept read or write concern"},
shardingState: {skip: "does not accept read or write concern"},
shutdown: {skip: "does not accept read or write concern"},
sleep: {skip: "does not accept read or write concern"},
diff --git a/jstests/sharding/rs_stepdown_and_pooling.js b/jstests/sharding/rs_stepdown_and_pooling.js
index 61c2a64ba9c..3c21b9ad4c6 100644
--- a/jstests/sharding/rs_stepdown_and_pooling.js
+++ b/jstests/sharding/rs_stepdown_and_pooling.js
@@ -44,9 +44,8 @@ if (is32Bits && _isWindows()) {
// Make sure we return connections back to the pool
gc();
- // Don't make test fragile by linking to format of shardConnPoolStats, but this is useful if
- // something goes wrong.
- var connPoolStats = mongos.getDB("admin").runCommand({shardConnPoolStats: 1});
+ // Log connPoolStats for debugging purposes.
+ var connPoolStats = mongos.getDB("admin").runCommand({connPoolStats: 1});
printjson(connPoolStats);
jsTest.log("Stepdown primary and then step back up...");
diff --git a/jstests/sharding/safe_secondary_reads_drop_recreate.js b/jstests/sharding/safe_secondary_reads_drop_recreate.js
index fcea81295a0..b207d25d91c 100644
--- a/jstests/sharding/safe_secondary_reads_drop_recreate.js
+++ b/jstests/sharding/safe_secondary_reads_drop_recreate.js
@@ -287,7 +287,6 @@ let testCases = {
setParameter: {skip: "does not return user data"},
setShardVersion: {skip: "does not return user data"},
shardCollection: {skip: "primary only"},
- shardConnPoolStats: {skip: "does not return user data"},
shardingState: {skip: "does not return user data"},
shutdown: {skip: "does not return user data"},
sleep: {skip: "does not return user data"},
diff --git a/jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js b/jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js
index 7bcf632dbfa..f90dbb90f21 100644
--- a/jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js
+++ b/jstests/sharding/safe_secondary_reads_single_migration_suspend_range_deletion.js
@@ -359,7 +359,6 @@ let testCases = {
setParameter: {skip: "does not return user data"},
setShardVersion: {skip: "does not return user data"},
shardCollection: {skip: "primary only"},
- shardConnPoolStats: {skip: "does not return user data"},
shardingState: {skip: "does not return user data"},
shutdown: {skip: "does not return user data"},
sleep: {skip: "does not return user data"},
diff --git a/jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js b/jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js
index 4982a2dc9a0..a81d7c0b47e 100644
--- a/jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js
+++ b/jstests/sharding/safe_secondary_reads_single_migration_waitForDelete.js
@@ -294,7 +294,6 @@ let testCases = {
setParameter: {skip: "does not return user data"},
setShardVersion: {skip: "does not return user data"},
shardCollection: {skip: "primary only"},
- shardConnPoolStats: {skip: "does not return user data"},
shardingState: {skip: "does not return user data"},
shutdown: {skip: "does not return user data"},
sleep: {skip: "does not return user data"},
diff --git a/jstests/sharding/shard_kill_and_pooling.js b/jstests/sharding/shard_kill_and_pooling.js
index 4fb49741a1c..b95e34d30c2 100644
--- a/jstests/sharding/shard_kill_and_pooling.js
+++ b/jstests/sharding/shard_kill_and_pooling.js
@@ -43,10 +43,8 @@ for (var test = 0; test < 2; test++) {
conns[i].close();
}
- // Don't make test fragile by linking to format of shardConnPoolStats, but this is
- // useful if
- // something goes wrong.
- var connPoolStats = mongos.getDB("admin").runCommand({shardConnPoolStats: 1});
+ // Log connPoolStats for debugging purposes.
+ var connPoolStats = mongos.getDB("admin").runCommand({connPoolStats: 1});
printjson(connPoolStats);
jsTest.log("Shutdown shard " + (killWith == 9 ? "uncleanly" : "") + "...");
diff --git a/src/mongo/db/commands/conn_pool_stats.cpp b/src/mongo/db/commands/conn_pool_stats.cpp
index 218f1c7d90e..3952309e987 100644
--- a/src/mongo/db/commands/conn_pool_stats.cpp
+++ b/src/mongo/db/commands/conn_pool_stats.cpp
@@ -113,48 +113,5 @@ public:
} poolStatsCmd;
-// This command currently returns nothing, since the shard connection pool no longer exists (v4.7+).
-class ShardedPoolStats final : public BasicCommand {
-public:
- ShardedPoolStats() : BasicCommand("shardConnPoolStats") {}
-
- std::string help() const override {
- return "stats about the shard connection pool (DEPRECATED)";
- }
-
- bool supportsWriteConcern(const BSONObj& cmd) const override {
- return false;
- }
-
- AllowedOnSecondary secondaryAllowed(ServiceContext*) const override {
- return AllowedOnSecondary::kAlways;
- }
-
- /**
- * Requires the same privileges as the connPoolStats command.
- */
- void addRequiredPrivileges(const std::string& dbname,
- const BSONObj& cmdObj,
- std::vector<Privilege>* out) const override {
- ActionSet actions;
- actions.addAction(ActionType::connPoolStats);
- out->push_back(Privilege(ResourcePattern::forClusterResource(), actions));
- }
-
- bool run(OperationContext* opCtx,
- const std::string& dbname,
- const mongo::BSONObj& cmdObj,
- mongo::BSONObjBuilder& result) override {
- // Connection information
- executor::ConnectionPoolStats stats{};
- stats.appendToBSON(result);
-
- // Thread connection information
- result.append("threads", BSONObj());
- return true;
- }
-
-} shardedPoolStatsCmd;
-
} // namespace
} // namespace mongo