diff options
Diffstat (limited to 'src/mongo/s/commands')
55 files changed, 34 insertions, 158 deletions
diff --git a/src/mongo/s/commands/cluster_add_shard_cmd.cpp b/src/mongo/s/commands/cluster_add_shard_cmd.cpp index c54804992d2..dafc4b0ef30 100644 --- a/src/mongo/s/commands/cluster_add_shard_cmd.cpp +++ b/src/mongo/s/commands/cluster_add_shard_cmd.cpp @@ -83,7 +83,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { auto parsedRequest = uassertStatusOK(AddShardRequest::parseFromMongosCommand(cmdObj)); diff --git a/src/mongo/s/commands/cluster_add_shard_to_zone_cmd.cpp b/src/mongo/s/commands/cluster_add_shard_to_zone_cmd.cpp index 43f2b4a3539..aa6917903ca 100644 --- a/src/mongo/s/commands/cluster_add_shard_to_zone_cmd.cpp +++ b/src/mongo/s/commands/cluster_add_shard_to_zone_cmd.cpp @@ -99,7 +99,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { auto parsedRequest = uassertStatusOK(AddShardToZoneRequest::parseFromMongosCommand(cmdObj)); diff --git a/src/mongo/s/commands/cluster_aggregate.cpp b/src/mongo/s/commands/cluster_aggregate.cpp index bdb4be00869..acfe13c9494 100644 --- a/src/mongo/s/commands/cluster_aggregate.cpp +++ b/src/mongo/s/commands/cluster_aggregate.cpp @@ -85,7 +85,6 @@ Status ClusterAggregate::runAggregate(OperationContext* opCtx, const Namespaces& namespaces, const AggregationRequest& request, BSONObj cmdObj, - int options, BSONObjBuilder* result) { auto const catalogCache = Grid::get(opCtx)->catalogCache(); @@ -118,13 +117,8 @@ Status ClusterAggregate::runAggregate(OperationContext* opCtx, } if (!executionNsRoutingInfo.cm()) { - return aggPassthrough(opCtx, - namespaces, - executionNsRoutingInfo.primary()->getId(), - request, - cmdObj, - result, - options); + return aggPassthrough( + opCtx, namespaces, executionNsRoutingInfo.primary()->getId(), request, cmdObj, result); } const auto chunkMgr = executionNsRoutingInfo.cm(); @@ -204,7 +198,6 @@ Status ClusterAggregate::runAggregate(OperationContext* opCtx, Strategy::commandOp(opCtx, namespaces.executionNss.db().toString(), shardedCommand, - options, namespaces.executionNss.ns(), shardQuery, request.getCollation(), @@ -291,7 +284,7 @@ Status ClusterAggregate::runAggregate(OperationContext* opCtx, ShardConnection conn(mergingShard->getConnString(), outputNsOrEmpty); BSONObj mergedResults = - aggRunCommand(opCtx, conn.get(), namespaces, request, mergeCmd.freeze().toBson(), options); + aggRunCommand(opCtx, conn.get(), namespaces, request, mergeCmd.freeze().toBson()); conn.done(); if (auto wcErrorElem = mergedResults["writeConcernError"]) { @@ -412,15 +405,13 @@ BSONObj ClusterAggregate::aggRunCommand(OperationContext* opCtx, DBClientBase* conn, const Namespaces& namespaces, const AggregationRequest& aggRequest, - BSONObj cmd, - int queryOptions) { + BSONObj cmd) { // Temporary hack. See comment on declaration for details. auto cursor = conn->query(namespaces.executionNss.db() + ".$cmd", cmd, - -1, // nToReturn - 0, // nToSkip - NULL, // fieldsToReturn - queryOptions); + -1, // nToReturn + 0, // nToSkip + NULL); massert(17014, str::stream() << "aggregate command didn't return results on host: " << conn->toString(), @@ -455,8 +446,7 @@ Status ClusterAggregate::aggPassthrough(OperationContext* opCtx, const ShardId& shardId, const AggregationRequest& aggRequest, BSONObj cmdObj, - BSONObjBuilder* out, - int queryOptions) { + BSONObjBuilder* out) { // Temporary hack. See comment on declaration for details. auto shardStatus = Grid::get(opCtx)->shardRegistry()->getShard(opCtx, shardId); if (!shardStatus.isOK()) { @@ -472,7 +462,7 @@ Status ClusterAggregate::aggPassthrough(OperationContext* opCtx, } ShardConnection conn(shardStatus.getValue()->getConnString(), ""); - BSONObj result = aggRunCommand(opCtx, conn.get(), namespaces, aggRequest, cmdObj, queryOptions); + BSONObj result = aggRunCommand(opCtx, conn.get(), namespaces, aggRequest, cmdObj); conn.done(); // First append the properly constructed writeConcernError. It will then be skipped @@ -500,7 +490,7 @@ Status ClusterAggregate::aggPassthrough(OperationContext* opCtx, nsStruct.executionNss = resolvedView.getNamespace(); return ClusterAggregate::runAggregate( - opCtx, nsStruct, resolvedAggRequest, resolvedAggCmd, queryOptions, out); + opCtx, nsStruct, resolvedAggRequest, resolvedAggCmd, out); } return getStatusFromCommandResult(result); diff --git a/src/mongo/s/commands/cluster_aggregate.h b/src/mongo/s/commands/cluster_aggregate.h index 591b3f070d2..3ac45baeb8d 100644 --- a/src/mongo/s/commands/cluster_aggregate.h +++ b/src/mongo/s/commands/cluster_aggregate.h @@ -75,7 +75,6 @@ public: const Namespaces& namespaces, const AggregationRequest& request, BSONObj cmdObj, - int options, BSONObjBuilder* result); private: @@ -95,16 +94,14 @@ private: DBClientBase* conn, const Namespaces& namespaces, const AggregationRequest& aggRequest, - BSONObj cmd, - int queryOptions); + BSONObj cmd); static Status aggPassthrough(OperationContext* opCtx, const Namespaces& namespaces, const ShardId& shardId, const AggregationRequest& aggRequest, BSONObj cmd, - BSONObjBuilder* result, - int queryOptions); + BSONObjBuilder* result); }; } // namespace mongo diff --git a/src/mongo/s/commands/cluster_apply_ops_cmd.cpp b/src/mongo/s/commands/cluster_apply_ops_cmd.cpp index a0fc658a5dd..fd15a41f11f 100644 --- a/src/mongo/s/commands/cluster_apply_ops_cmd.cpp +++ b/src/mongo/s/commands/cluster_apply_ops_cmd.cpp @@ -59,7 +59,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbName, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { uasserted(ErrorCodes::CommandNotSupported, "applyOps not allowed through mongos"); diff --git a/src/mongo/s/commands/cluster_available_query_options_cmd.cpp b/src/mongo/s/commands/cluster_available_query_options_cmd.cpp index 1dcffe67fb4..e49bc1708d3 100644 --- a/src/mongo/s/commands/cluster_available_query_options_cmd.cpp +++ b/src/mongo/s/commands/cluster_available_query_options_cmd.cpp @@ -56,7 +56,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { result << "options" << QueryOption_AllSupportedForSharding; diff --git a/src/mongo/s/commands/cluster_compact_cmd.cpp b/src/mongo/s/commands/cluster_compact_cmd.cpp index 83c7f1c5990..ab0607ed626 100644 --- a/src/mongo/s/commands/cluster_compact_cmd.cpp +++ b/src/mongo/s/commands/cluster_compact_cmd.cpp @@ -60,7 +60,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbName, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { uasserted(ErrorCodes::CommandNotSupported, "compact not allowed through mongos"); diff --git a/src/mongo/s/commands/cluster_control_balancer_cmd.cpp b/src/mongo/s/commands/cluster_control_balancer_cmd.cpp index b1dabe7ad8c..36a6a817620 100644 --- a/src/mongo/s/commands/cluster_control_balancer_cmd.cpp +++ b/src/mongo/s/commands/cluster_control_balancer_cmd.cpp @@ -80,7 +80,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { auto configShard = Grid::get(opCtx)->shardRegistry()->getConfigShard(); diff --git a/src/mongo/s/commands/cluster_count_cmd.cpp b/src/mongo/s/commands/cluster_count_cmd.cpp index 08c92754096..b92011c56e0 100644 --- a/src/mongo/s/commands/cluster_count_cmd.cpp +++ b/src/mongo/s/commands/cluster_count_cmd.cpp @@ -72,7 +72,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { const NamespaceString nss(parseNs(dbname, cmdObj)); @@ -138,14 +137,8 @@ public: } std::vector<Strategy::CommandResult> countResult; - Strategy::commandOp(opCtx, - dbname, - countCmdBuilder.done(), - options, - nss.ns(), - filter, - collation, - &countResult); + Strategy::commandOp( + opCtx, dbname, countCmdBuilder.done(), nss.ns(), filter, collation, &countResult); if (countResult.size() == 1 && ResolvedView::isResolvedViewErrorResponse(countResult[0].result)) { @@ -171,7 +164,7 @@ public: BSONObjBuilder aggResult; Command::findCommand("aggregate") - ->run(opCtx, dbname, resolvedAggCmd, options, errmsg, aggResult); + ->run(opCtx, dbname, resolvedAggCmd, errmsg, aggResult); result.resetToEmpty(); ViewResponseFormatter formatter(aggResult.obj()); @@ -256,7 +249,6 @@ public: Strategy::commandOp(opCtx, dbname, explainCmdBob.obj(), - options, nss.ns(), targetingQuery, targetingCollation, @@ -292,7 +284,7 @@ public: nsStruct.executionNss = resolvedAggRequest.getNamespaceString(); return ClusterAggregate::runAggregate( - opCtx, nsStruct, resolvedAggRequest, resolvedAggCmd, 0, out); + opCtx, nsStruct, resolvedAggRequest, resolvedAggCmd, out); } const char* mongosStageName = ClusterExplain::getStageNameForReadOp(shardResults, cmdObj); diff --git a/src/mongo/s/commands/cluster_current_op.cpp b/src/mongo/s/commands/cluster_current_op.cpp index 7f296320f71..14f4dc5e46d 100644 --- a/src/mongo/s/commands/cluster_current_op.cpp +++ b/src/mongo/s/commands/cluster_current_op.cpp @@ -83,7 +83,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbName, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& output) override { auto requests = buildRequestsForAllShards(opCtx, cmdObj); diff --git a/src/mongo/s/commands/cluster_db_stats_cmd.cpp b/src/mongo/s/commands/cluster_db_stats_cmd.cpp index d5f128adb32..cb7877d6cf8 100644 --- a/src/mongo/s/commands/cluster_db_stats_cmd.cpp +++ b/src/mongo/s/commands/cluster_db_stats_cmd.cpp @@ -66,7 +66,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbName, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& output) override { auto requests = buildRequestsForAllShards(opCtx, cmdObj); diff --git a/src/mongo/s/commands/cluster_drop_cmd.cpp b/src/mongo/s/commands/cluster_drop_cmd.cpp index 583c8902cbf..0ca3e6396bd 100644 --- a/src/mongo/s/commands/cluster_drop_cmd.cpp +++ b/src/mongo/s/commands/cluster_drop_cmd.cpp @@ -74,7 +74,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { const NamespaceString nss(parseNsCollectionRequired(dbname, cmdObj)); diff --git a/src/mongo/s/commands/cluster_drop_database_cmd.cpp b/src/mongo/s/commands/cluster_drop_database_cmd.cpp index 178fc5f36bc..5d88ed0fa2e 100644 --- a/src/mongo/s/commands/cluster_drop_database_cmd.cpp +++ b/src/mongo/s/commands/cluster_drop_database_cmd.cpp @@ -73,7 +73,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { uassert(ErrorCodes::IllegalOperation, diff --git a/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp b/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp index 3eb555f7ca6..a5716d67797 100644 --- a/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp +++ b/src/mongo/s/commands/cluster_enable_sharding_cmd.cpp @@ -89,7 +89,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname_unused, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { const std::string dbname = parseNs("", cmdObj); diff --git a/src/mongo/s/commands/cluster_explain_cmd.cpp b/src/mongo/s/commands/cluster_explain_cmd.cpp index 83ef8616883..fed93b5247e 100644 --- a/src/mongo/s/commands/cluster_explain_cmd.cpp +++ b/src/mongo/s/commands/cluster_explain_cmd.cpp @@ -109,7 +109,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbName, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { auto verbosity = ExplainOptions::parseCmdBSON(cmdObj); diff --git a/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp b/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp index da5c31572dd..c586d0ad6af 100644 --- a/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp +++ b/src/mongo/s/commands/cluster_find_and_modify_cmd.cpp @@ -160,7 +160,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbName, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { const NamespaceString nss = parseNsCollectionRequired(dbName, cmdObj); diff --git a/src/mongo/s/commands/cluster_find_cmd.cpp b/src/mongo/s/commands/cluster_find_cmd.cpp index 55ef32243c9..a09a839a94a 100644 --- a/src/mongo/s/commands/cluster_find_cmd.cpp +++ b/src/mongo/s/commands/cluster_find_cmd.cpp @@ -137,13 +137,12 @@ public: resolvedView.asExpandedViewAggregation(aggRequestOnView.getValue()); auto resolvedAggCmd = resolvedAggRequest.serializeToCommandObj().toBson(); - int queryOptions = 0; ClusterAggregate::Namespaces nsStruct; nsStruct.requestedNss = std::move(nss); nsStruct.executionNss = std::move(resolvedView.getNamespace()); auto status = ClusterAggregate::runAggregate( - opCtx, nsStruct, resolvedAggRequest, resolvedAggCmd, queryOptions, out); + opCtx, nsStruct, resolvedAggRequest, resolvedAggCmd, out); appendCommandStatus(*out, status); return status; } @@ -154,7 +153,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) final { // We count find command as a query op. @@ -214,7 +212,7 @@ public: nsStruct.executionNss = std::move(resolvedView.getNamespace()); auto status = ClusterAggregate::runAggregate( - opCtx, nsStruct, resolvedAggRequest, resolvedAggCmd, options, &result); + opCtx, nsStruct, resolvedAggRequest, resolvedAggCmd, &result); appendCommandStatus(result, status); return status.isOK(); } diff --git a/src/mongo/s/commands/cluster_flush_router_config_cmd.cpp b/src/mongo/s/commands/cluster_flush_router_config_cmd.cpp index 8931166863c..b61b2b4ccba 100644 --- a/src/mongo/s/commands/cluster_flush_router_config_cmd.cpp +++ b/src/mongo/s/commands/cluster_flush_router_config_cmd.cpp @@ -67,7 +67,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { Grid::get(opCtx)->catalogCache()->purgeAllDatabases(); diff --git a/src/mongo/s/commands/cluster_fsync_cmd.cpp b/src/mongo/s/commands/cluster_fsync_cmd.cpp index a75c0b3629e..8237934d675 100644 --- a/src/mongo/s/commands/cluster_fsync_cmd.cpp +++ b/src/mongo/s/commands/cluster_fsync_cmd.cpp @@ -70,7 +70,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { if (cmdObj["lock"].trueValue()) { diff --git a/src/mongo/s/commands/cluster_ftdc_commands.cpp b/src/mongo/s/commands/cluster_ftdc_commands.cpp index f8d55e352ef..9a29384298b 100644 --- a/src/mongo/s/commands/cluster_ftdc_commands.cpp +++ b/src/mongo/s/commands/cluster_ftdc_commands.cpp @@ -73,7 +73,6 @@ public: bool run(OperationContext* opCtx, const std::string& db, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { diff --git a/src/mongo/s/commands/cluster_get_last_error_cmd.cpp b/src/mongo/s/commands/cluster_get_last_error_cmd.cpp index 93ecba0fded..1d9b9021bae 100644 --- a/src/mongo/s/commands/cluster_get_last_error_cmd.cpp +++ b/src/mongo/s/commands/cluster_get_last_error_cmd.cpp @@ -209,7 +209,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { // Mongos GLE - finicky. diff --git a/src/mongo/s/commands/cluster_get_prev_error_cmd.cpp b/src/mongo/s/commands/cluster_get_prev_error_cmd.cpp index 57ffc184cc4..58d776293d8 100644 --- a/src/mongo/s/commands/cluster_get_prev_error_cmd.cpp +++ b/src/mongo/s/commands/cluster_get_prev_error_cmd.cpp @@ -64,7 +64,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { errmsg += "getpreverror not supported for sharded environments"; diff --git a/src/mongo/s/commands/cluster_get_shard_map_cmd.cpp b/src/mongo/s/commands/cluster_get_shard_map_cmd.cpp index 5e6be95bebe..69c9ee9f1dc 100644 --- a/src/mongo/s/commands/cluster_get_shard_map_cmd.cpp +++ b/src/mongo/s/commands/cluster_get_shard_map_cmd.cpp @@ -70,7 +70,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { // MongoD instances do not know that they are part of a sharded cluster until they diff --git a/src/mongo/s/commands/cluster_get_shard_version_cmd.cpp b/src/mongo/s/commands/cluster_get_shard_version_cmd.cpp index 2bb23453bba..8477c1140cd 100644 --- a/src/mongo/s/commands/cluster_get_shard_version_cmd.cpp +++ b/src/mongo/s/commands/cluster_get_shard_version_cmd.cpp @@ -82,7 +82,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { const NamespaceString nss(parseNs(dbname, cmdObj)); diff --git a/src/mongo/s/commands/cluster_getmore_cmd.cpp b/src/mongo/s/commands/cluster_getmore_cmd.cpp index e0af7c39663..8d01a481f11 100644 --- a/src/mongo/s/commands/cluster_getmore_cmd.cpp +++ b/src/mongo/s/commands/cluster_getmore_cmd.cpp @@ -94,7 +94,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) final { // Counted as a getMore, not as a command. diff --git a/src/mongo/s/commands/cluster_index_filter_cmd.cpp b/src/mongo/s/commands/cluster_index_filter_cmd.cpp index 35612ecd08e..73f1f9cfe0f 100644 --- a/src/mongo/s/commands/cluster_index_filter_cmd.cpp +++ b/src/mongo/s/commands/cluster_index_filter_cmd.cpp @@ -94,7 +94,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { const NamespaceString nss(parseNs(dbname, cmdObj)); @@ -108,7 +107,7 @@ public: vector<Strategy::CommandResult> results; const BSONObj query; Strategy::commandOp( - opCtx, dbname, cmdObj, options, nss.ns(), query, CollationSpec::kSimpleSpec, &results); + opCtx, dbname, cmdObj, nss.ns(), query, CollationSpec::kSimpleSpec, &results); // Set value of first shard result's "ok" field. bool clusterCmdResult = true; diff --git a/src/mongo/s/commands/cluster_is_db_grid_cmd.cpp b/src/mongo/s/commands/cluster_is_db_grid_cmd.cpp index 6c9705ff35c..57e7b579e41 100644 --- a/src/mongo/s/commands/cluster_is_db_grid_cmd.cpp +++ b/src/mongo/s/commands/cluster_is_db_grid_cmd.cpp @@ -55,7 +55,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { result.append("isdbgrid", 1); diff --git a/src/mongo/s/commands/cluster_is_master_cmd.cpp b/src/mongo/s/commands/cluster_is_master_cmd.cpp index 761aca9bba1..ddb9d1c7844 100644 --- a/src/mongo/s/commands/cluster_is_master_cmd.cpp +++ b/src/mongo/s/commands/cluster_is_master_cmd.cpp @@ -70,7 +70,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { diff --git a/src/mongo/s/commands/cluster_kill_op.cpp b/src/mongo/s/commands/cluster_kill_op.cpp index d636d6922b3..653a19a152d 100644 --- a/src/mongo/s/commands/cluster_kill_op.cpp +++ b/src/mongo/s/commands/cluster_kill_op.cpp @@ -79,7 +79,6 @@ public: bool run(OperationContext* opCtx, const std::string& db, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) final { // The format of op is shardid:opid diff --git a/src/mongo/s/commands/cluster_list_databases_cmd.cpp b/src/mongo/s/commands/cluster_list_databases_cmd.cpp index 6b2d8b9400d..3e9d2ecddcd 100644 --- a/src/mongo/s/commands/cluster_list_databases_cmd.cpp +++ b/src/mongo/s/commands/cluster_list_databases_cmd.cpp @@ -86,7 +86,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname_unused, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { const bool nameOnly = cmdObj["nameOnly"].trueValue(); diff --git a/src/mongo/s/commands/cluster_list_shards_cmd.cpp b/src/mongo/s/commands/cluster_list_shards_cmd.cpp index af90c1bff04..2d5759acea3 100644 --- a/src/mongo/s/commands/cluster_list_shards_cmd.cpp +++ b/src/mongo/s/commands/cluster_list_shards_cmd.cpp @@ -71,7 +71,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { auto shardsStatus = grid.catalogClient(opCtx)->getAllShards( diff --git a/src/mongo/s/commands/cluster_map_reduce_cmd.cpp b/src/mongo/s/commands/cluster_map_reduce_cmd.cpp index 5c1b6445615..b424ddc6f42 100644 --- a/src/mongo/s/commands/cluster_map_reduce_cmd.cpp +++ b/src/mongo/s/commands/cluster_map_reduce_cmd.cpp @@ -179,7 +179,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { Timer t; @@ -326,7 +325,7 @@ public: try { Strategy::commandOp( - opCtx, dbname, shardedCommand, 0, nss.ns(), q, collation, &mrCommandResults); + opCtx, dbname, shardedCommand, nss.ns(), q, collation, &mrCommandResults); } catch (DBException& e) { e.addContext(str::stream() << "could not run map command on all shards for ns " << nss.ns() @@ -479,7 +478,6 @@ public: Strategy::commandOp(opCtx, outDB, finalCmdObj, - 0, outputCollNss.ns(), query, CollationSpec::kSimpleSpec, diff --git a/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp b/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp index 2a85b645df0..37c0bfeba59 100644 --- a/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp +++ b/src/mongo/s/commands/cluster_merge_chunks_cmd.cpp @@ -102,7 +102,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) override { const NamespaceString nss(parseNs(dbname, cmdObj)); diff --git a/src/mongo/s/commands/cluster_move_chunk_cmd.cpp b/src/mongo/s/commands/cluster_move_chunk_cmd.cpp index e597e80eeaa..624d5ff22e0 100644 --- a/src/mongo/s/commands/cluster_move_chunk_cmd.cpp +++ b/src/mongo/s/commands/cluster_move_chunk_cmd.cpp @@ -98,7 +98,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { Timer t; diff --git a/src/mongo/s/commands/cluster_move_primary_cmd.cpp b/src/mongo/s/commands/cluster_move_primary_cmd.cpp index e1746bebd72..49d167c09d2 100644 --- a/src/mongo/s/commands/cluster_move_primary_cmd.cpp +++ b/src/mongo/s/commands/cluster_move_primary_cmd.cpp @@ -103,7 +103,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname_unused, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { const string dbname = parseNs("", cmdObj); diff --git a/src/mongo/s/commands/cluster_netstat_cmd.cpp b/src/mongo/s/commands/cluster_netstat_cmd.cpp index 0d50223c112..be78b5b153a 100644 --- a/src/mongo/s/commands/cluster_netstat_cmd.cpp +++ b/src/mongo/s/commands/cluster_netstat_cmd.cpp @@ -68,7 +68,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { result.append("configserver", diff --git a/src/mongo/s/commands/cluster_pipeline_cmd.cpp b/src/mongo/s/commands/cluster_pipeline_cmd.cpp index 21571bd6e4f..460363bb1be 100644 --- a/src/mongo/s/commands/cluster_pipeline_cmd.cpp +++ b/src/mongo/s/commands/cluster_pipeline_cmd.cpp @@ -76,7 +76,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { const NamespaceString nss(parseNsCollectionRequired(dbname, cmdObj)); @@ -89,8 +88,8 @@ public: ClusterAggregate::Namespaces nsStruct; nsStruct.requestedNss = nss; nsStruct.executionNss = std::move(nss); - auto status = ClusterAggregate::runAggregate( - opCtx, nsStruct, request.getValue(), cmdObj, options, &result); + auto status = + ClusterAggregate::runAggregate(opCtx, nsStruct, request.getValue(), cmdObj, &result); appendCommandStatus(result, status); return status.isOK(); } @@ -118,17 +117,11 @@ public: BSON("$readPreference" << readPrefObj)); } - int options = 0; - if (serverSelectionMetadata.isSecondaryOk()) { - options |= QueryOption_SlaveOk; - } - ClusterAggregate::Namespaces nsStruct; nsStruct.requestedNss = nss; nsStruct.executionNss = std::move(nss); - return ClusterAggregate::runAggregate( - opCtx, nsStruct, request.getValue(), cmdObj, options, out); + return ClusterAggregate::runAggregate(opCtx, nsStruct, request.getValue(), cmdObj, out); } } clusterPipelineCmd; diff --git a/src/mongo/s/commands/cluster_plan_cache_cmd.cpp b/src/mongo/s/commands/cluster_plan_cache_cmd.cpp index 65f149927d0..87beef74b24 100644 --- a/src/mongo/s/commands/cluster_plan_cache_cmd.cpp +++ b/src/mongo/s/commands/cluster_plan_cache_cmd.cpp @@ -89,7 +89,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result); @@ -113,7 +112,6 @@ private: bool ClusterPlanCacheCmd::run(OperationContext* opCtx, const std::string& dbName, BSONObj& cmdObj, - int options, std::string& errMsg, BSONObjBuilder& result) { const NamespaceString nss(parseNsCollectionRequired(dbName, cmdObj)); @@ -124,7 +122,7 @@ bool ClusterPlanCacheCmd::run(OperationContext* opCtx, vector<Strategy::CommandResult> results; const BSONObj query; Strategy::commandOp( - opCtx, dbName, cmdObj, options, nss.ns(), query, CollationSpec::kSimpleSpec, &results); + opCtx, dbName, cmdObj, nss.ns(), query, CollationSpec::kSimpleSpec, &results); // Set value of first shard result's "ok" field. bool clusterCmdResult = true; diff --git a/src/mongo/s/commands/cluster_profile_cmd.cpp b/src/mongo/s/commands/cluster_profile_cmd.cpp index 74d6bf57cde..441411149a0 100644 --- a/src/mongo/s/commands/cluster_profile_cmd.cpp +++ b/src/mongo/s/commands/cluster_profile_cmd.cpp @@ -61,7 +61,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { errmsg = "profile currently not supported via mongos"; diff --git a/src/mongo/s/commands/cluster_remove_shard_cmd.cpp b/src/mongo/s/commands/cluster_remove_shard_cmd.cpp index edf4ca92c57..27d95b6210d 100644 --- a/src/mongo/s/commands/cluster_remove_shard_cmd.cpp +++ b/src/mongo/s/commands/cluster_remove_shard_cmd.cpp @@ -82,7 +82,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { uassert(ErrorCodes::TypeMismatch, diff --git a/src/mongo/s/commands/cluster_remove_shard_from_zone_cmd.cpp b/src/mongo/s/commands/cluster_remove_shard_from_zone_cmd.cpp index 18337e99d29..c9d808de67a 100644 --- a/src/mongo/s/commands/cluster_remove_shard_from_zone_cmd.cpp +++ b/src/mongo/s/commands/cluster_remove_shard_from_zone_cmd.cpp @@ -106,7 +106,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { auto parsedRequest = diff --git a/src/mongo/s/commands/cluster_repair_database_cmd.cpp b/src/mongo/s/commands/cluster_repair_database_cmd.cpp index c21aadd9917..55fa0e79565 100644 --- a/src/mongo/s/commands/cluster_repair_database_cmd.cpp +++ b/src/mongo/s/commands/cluster_repair_database_cmd.cpp @@ -62,7 +62,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbName, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& output) override { auto requests = buildRequestsForAllShards(opCtx, cmdObj); diff --git a/src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp b/src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp index 3c8ee464363..66c7f6722d8 100644 --- a/src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp +++ b/src/mongo/s/commands/cluster_repl_set_get_status_cmd.cpp @@ -67,7 +67,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { if (cmdObj["forShell"].trueValue()) { diff --git a/src/mongo/s/commands/cluster_reset_error_cmd.cpp b/src/mongo/s/commands/cluster_reset_error_cmd.cpp index 536c11bc0ba..e1d6b3db600 100644 --- a/src/mongo/s/commands/cluster_reset_error_cmd.cpp +++ b/src/mongo/s/commands/cluster_reset_error_cmd.cpp @@ -62,7 +62,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { LastError::get(cc()).reset(); diff --git a/src/mongo/s/commands/cluster_set_feature_compatibility_version_cmd.cpp b/src/mongo/s/commands/cluster_set_feature_compatibility_version_cmd.cpp index 59b2d6ef071..271ceb7faee 100644 --- a/src/mongo/s/commands/cluster_set_feature_compatibility_version_cmd.cpp +++ b/src/mongo/s/commands/cluster_set_feature_compatibility_version_cmd.cpp @@ -86,7 +86,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { const auto version = uassertStatusOK( diff --git a/src/mongo/s/commands/cluster_shard_collection_cmd.cpp b/src/mongo/s/commands/cluster_shard_collection_cmd.cpp index a1d99a608e6..5365dd1238f 100644 --- a/src/mongo/s/commands/cluster_shard_collection_cmd.cpp +++ b/src/mongo/s/commands/cluster_shard_collection_cmd.cpp @@ -177,7 +177,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { const NamespaceString nss(parseNs(dbname, cmdObj)); diff --git a/src/mongo/s/commands/cluster_shutdown_cmd.cpp b/src/mongo/s/commands/cluster_shutdown_cmd.cpp index 95db8c0c478..f429afef8c2 100644 --- a/src/mongo/s/commands/cluster_shutdown_cmd.cpp +++ b/src/mongo/s/commands/cluster_shutdown_cmd.cpp @@ -44,7 +44,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { // Never returns diff --git a/src/mongo/s/commands/cluster_split_cmd.cpp b/src/mongo/s/commands/cluster_split_cmd.cpp index 80ed1526663..5715e750dc4 100644 --- a/src/mongo/s/commands/cluster_split_cmd.cpp +++ b/src/mongo/s/commands/cluster_split_cmd.cpp @@ -126,7 +126,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { const NamespaceString nss(parseNs(dbname, cmdObj)); diff --git a/src/mongo/s/commands/cluster_update_zone_key_range_cmd.cpp b/src/mongo/s/commands/cluster_update_zone_key_range_cmd.cpp index f1616334ac0..2e48230bfe6 100644 --- a/src/mongo/s/commands/cluster_update_zone_key_range_cmd.cpp +++ b/src/mongo/s/commands/cluster_update_zone_key_range_cmd.cpp @@ -121,7 +121,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { auto parsedRequest = diff --git a/src/mongo/s/commands/cluster_user_management_commands.cpp b/src/mongo/s/commands/cluster_user_management_commands.cpp index 18aa7736fe7..7a569094447 100644 --- a/src/mongo/s/commands/cluster_user_management_commands.cpp +++ b/src/mongo/s/commands/cluster_user_management_commands.cpp @@ -89,7 +89,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { return Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementWriteCommand( @@ -128,7 +127,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { auth::CreateOrUpdateUserArgs args; @@ -178,7 +176,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { UserName userName; @@ -224,7 +221,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { const bool ok = Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementWriteCommand( @@ -265,7 +261,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { string userNameString; @@ -313,7 +308,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { string userNameString; @@ -365,7 +359,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { return Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementReadCommand( @@ -400,7 +393,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { return Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementWriteCommand( @@ -435,7 +427,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { const bool ok = Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementWriteCommand( @@ -476,7 +467,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { const bool ok = Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementWriteCommand( @@ -517,7 +507,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { const bool ok = Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementWriteCommand( @@ -558,7 +547,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { const bool ok = Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementWriteCommand( @@ -599,7 +587,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { const bool ok = Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementWriteCommand( @@ -643,7 +630,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { const bool ok = Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementWriteCommand( @@ -688,7 +674,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { const bool ok = Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementWriteCommand( @@ -733,7 +718,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { return Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementReadCommand( @@ -772,7 +756,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { AuthorizationManager* authzManager = getGlobalAuthorizationManager(); @@ -823,7 +806,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { return Grid::get(opCtx)->catalogClient(opCtx)->runUserManagementWriteCommand( @@ -913,7 +895,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { // Run the authSchemaUpgrade command on the config servers diff --git a/src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp b/src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp index 7f3e5e19c11..9ca29ed3d7d 100644 --- a/src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp +++ b/src/mongo/s/commands/cluster_whats_my_uri_cmd.cpp @@ -60,7 +60,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { result << "you" << cc().getRemote().toString(); diff --git a/src/mongo/s/commands/cluster_write_cmd.cpp b/src/mongo/s/commands/cluster_write_cmd.cpp index d9b650fad2d..d39adbd5e49 100644 --- a/src/mongo/s/commands/cluster_write_cmd.cpp +++ b/src/mongo/s/commands/cluster_write_cmd.cpp @@ -132,7 +132,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { BatchedCommandRequest request(_writeType); diff --git a/src/mongo/s/commands/commands_public.cpp b/src/mongo/s/commands/commands_public.cpp index 7499f7b9084..33836e9b997 100644 --- a/src/mongo/s/commands/commands_public.cpp +++ b/src/mongo/s/commands/commands_public.cpp @@ -213,7 +213,6 @@ protected: bool run(OperationContext* opCtx, const string& dbName, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& output) override { const NamespaceString nss(parseNsCollectionRequired(dbName, cmdObj)); @@ -263,7 +262,6 @@ protected: bool run(OperationContext* opCtx, const string& dbName, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) override { const NamespaceString nss(parseNs(dbName, cmdObj)); @@ -370,7 +368,6 @@ public: bool run(OperationContext* opCtx, const string& dbName, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& output) { const NamespaceString nss(parseNsCollectionRequired(dbName, cmdObj)); @@ -385,14 +382,8 @@ public: vector<Strategy::CommandResult> results; const BSONObj query; - Strategy::commandOp(opCtx, - dbName, - cmdObj, - options, - cm->getns(), - query, - CollationSpec::kSimpleSpec, - &results); + Strategy::commandOp( + opCtx, dbName, cmdObj, cm->getns(), query, CollationSpec::kSimpleSpec, &results); BSONObjBuilder rawResBuilder(output.subobjStart("raw")); bool isValid = true; @@ -448,7 +439,6 @@ public: bool run(OperationContext* opCtx, const string& dbName, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) override { uassertStatusOK(createShardDatabase(opCtx, dbName)); @@ -481,7 +471,6 @@ public: bool run(OperationContext* opCtx, const string& dbName, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) override { const auto fullNsFromElt = cmdObj.firstElement(); @@ -540,7 +529,6 @@ public: bool run(OperationContext* opCtx, const string& dbName, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) override { const auto todbElt = cmdObj["todb"]; @@ -614,7 +602,6 @@ public: bool run(OperationContext* opCtx, const string& dbName, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) override { const NamespaceString nss(parseNsCollectionRequired(dbName, cmdObj)); @@ -795,7 +782,6 @@ public: bool run(OperationContext* opCtx, const string& dbName, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) override { const NamespaceString nss(parseNs(dbName, cmdObj)); @@ -1000,7 +986,6 @@ public: bool run(OperationContext* opCtx, const string& dbName, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) override { const std::string ns = parseNs(dbName, cmdObj); @@ -1008,8 +993,7 @@ public: "Performing splitVector across dbs isn't supported via mongos", str::startsWith(ns, dbName)); - return NotAllowedOnShardedCollectionCmd::run( - opCtx, dbName, cmdObj, options, errmsg, result); + return NotAllowedOnShardedCollectionCmd::run(opCtx, dbName, cmdObj, errmsg, result); } } splitVectorCmd; @@ -1037,7 +1021,6 @@ public: bool run(OperationContext* opCtx, const string& dbName, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) override { const NamespaceString nss(parseNsCollectionRequired(dbName, cmdObj)); @@ -1077,7 +1060,7 @@ public: BSONObjBuilder aggResult; Command::findCommand("aggregate") - ->run(opCtx, dbName, resolvedAggCmd, options, errmsg, aggResult); + ->run(opCtx, dbName, resolvedAggCmd, errmsg, aggResult); ViewResponseFormatter formatter(aggResult.obj()); auto formatStatus = formatter.appendAsDistinctResponse(&result); @@ -1127,7 +1110,7 @@ public: ShardConnection conn(shardStatus.getValue()->getConnString(), nss.ns()); BSONObj res; - bool ok = conn->runCommand(nss.db().toString(), cmdObj, res, options); + bool ok = conn->runCommand(nss.db().toString(), cmdObj, res); conn.done(); if (!ok) { @@ -1196,7 +1179,6 @@ public: Strategy::commandOp(opCtx, dbname, explainCmdBob.obj(), - options, nss.ns(), targetingQuery, targetingCollation.getValue(), @@ -1233,7 +1215,7 @@ public: nsStruct.executionNss = resolvedAggRequest.getNamespaceString(); return ClusterAggregate::runAggregate( - opCtx, nsStruct, resolvedAggRequest, resolvedAggCmd, 0, out); + opCtx, nsStruct, resolvedAggRequest, resolvedAggCmd, out); } const char* mongosStageName = ClusterExplain::getStageNameForReadOp(shardResults, cmdObj); @@ -1279,7 +1261,6 @@ public: bool run(OperationContext* opCtx, const string& dbName, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) override { const NamespaceString nss(parseNs(dbName, cmdObj)); @@ -1298,7 +1279,7 @@ public: vector<Strategy::CommandResult> results; Strategy::commandOp( - opCtx, dbName, cmdObj, 0, nss.ns(), finder, CollationSpec::kSimpleSpec, &results); + opCtx, dbName, cmdObj, nss.ns(), finder, CollationSpec::kSimpleSpec, &results); verify(results.size() == 1); // querying on shard key so should only talk to one shard BSONObj res = results.begin()->result; @@ -1334,7 +1315,6 @@ public: Strategy::commandOp(opCtx, dbName, shardCmd, - 0, nss.ns(), finder, CollationSpec::kSimpleSpec, @@ -1423,7 +1403,6 @@ public: bool run(OperationContext* opCtx, const string& dbName, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) override { const NamespaceString nss(parseNsCollectionRequired(dbName, cmdObj)); @@ -1569,7 +1548,6 @@ public: bool run(OperationContext* opCtx, const string& dbName, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) override { RARELY { @@ -1615,7 +1593,6 @@ public: bool run(OperationContext* opCtx, const string& dbName, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) final { auto nss = NamespaceString::makeListCollectionsNSS(dbName); @@ -1665,7 +1642,6 @@ public: bool run(OperationContext* opCtx, const string& dbName, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) final { const NamespaceString nss(parseNsCollectionRequired(dbName, cmdObj)); diff --git a/src/mongo/s/commands/strategy.cpp b/src/mongo/s/commands/strategy.cpp index 8313779ad17..c49752c8b74 100644 --- a/src/mongo/s/commands/strategy.cpp +++ b/src/mongo/s/commands/strategy.cpp @@ -452,12 +452,11 @@ void Strategy::clientCommandOp(OperationContext* opCtx, void Strategy::commandOp(OperationContext* opCtx, const string& db, const BSONObj& command, - int options, const string& versionedNS, const BSONObj& targetingQuery, const BSONObj& targetingCollation, std::vector<CommandResult>* results) { - QuerySpec qSpec(db + ".$cmd", command, BSONObj(), 0, 1, options); + QuerySpec qSpec(db + ".$cmd", command, BSONObj(), 0, 1, 0); ParallelSortClusteredCursor cursor( qSpec, CommandInfo(versionedNS, targetingQuery, targetingCollation)); @@ -651,7 +650,6 @@ Status Strategy::explainFind(OperationContext* opCtx, Strategy::commandOp(opCtx, qr.nss().db().toString(), explainCmdBob.obj(), - options, qr.nss().toString(), qr.getFilter(), qr.getCollation(), @@ -746,14 +744,14 @@ void execCommandClient(OperationContext* opCtx, bool ok = false; try { if (!supportsWriteConcern) { - ok = c->run(opCtx, dbname.toString(), cmdObj, queryOptions, errmsg, result); + ok = c->run(opCtx, dbname.toString(), cmdObj, errmsg, result); } else { // Change the write concern while running the command. const auto oldWC = opCtx->getWriteConcern(); ON_BLOCK_EXIT([&] { opCtx->setWriteConcern(oldWC); }); opCtx->setWriteConcern(wcResult.getValue()); - ok = c->run(opCtx, dbname.toString(), cmdObj, queryOptions, errmsg, result); + ok = c->run(opCtx, dbname.toString(), cmdObj, errmsg, result); } } catch (const DBException& e) { result.resetToEmpty(); diff --git a/src/mongo/s/commands/strategy.h b/src/mongo/s/commands/strategy.h index c13e4354be1..c41fbef75b2 100644 --- a/src/mongo/s/commands/strategy.h +++ b/src/mongo/s/commands/strategy.h @@ -122,7 +122,6 @@ public: static void commandOp(OperationContext* opCtx, const std::string& db, const BSONObj& command, - int options, const std::string& versionedNS, const BSONObj& targetingQuery, const BSONObj& targetingCollation, |