diff options
author | Mathias Stearn <mathias@10gen.com> | 2017-04-07 19:17:04 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2017-04-12 16:00:07 -0400 |
commit | 760b1df21159bfee0fdb650288113fa568a1bafc (patch) | |
tree | 3980ae627caf095de95ce963eeca61aa7af988a7 | |
parent | 731790d836e22babbd953c68acbe36cdd97694e8 (diff) | |
download | mongo-760b1df21159bfee0fdb650288113fa568a1bafc.tar.gz |
SERVER-28701 Remove queryOptions argument from Command::run()
153 files changed, 42 insertions, 340 deletions
diff --git a/src/mongo/db/auth/sasl_commands.cpp b/src/mongo/db/auth/sasl_commands.cpp index 85289515f95..d311f174b6b 100644 --- a/src/mongo/db/auth/sasl_commands.cpp +++ b/src/mongo/db/auth/sasl_commands.cpp @@ -76,7 +76,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& db, BSONObj& cmdObj, - int options, std::string& ignored, BSONObjBuilder& result); @@ -104,7 +103,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& db, BSONObj& cmdObj, - int options, std::string& ignored, BSONObjBuilder& result); @@ -273,7 +271,6 @@ void CmdSaslStart::redactForLogging(mutablebson::Document* cmdObj) { bool CmdSaslStart::run(OperationContext* opCtx, const std::string& db, BSONObj& cmdObj, - int options, std::string& ignored, BSONObjBuilder& result) { Client* client = Client::getCurrent(); @@ -315,7 +312,6 @@ void CmdSaslContinue::help(std::stringstream& os) const { bool CmdSaslContinue::run(OperationContext* opCtx, const std::string& db, BSONObj& cmdObj, - int options, std::string& ignored, BSONObjBuilder& result) { Client* client = Client::getCurrent(); diff --git a/src/mongo/db/commands.h b/src/mongo/db/commands.h index 02e9f125e95..3a72bd0b381 100644 --- a/src/mongo/db/commands.h +++ b/src/mongo/db/commands.h @@ -137,7 +137,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& db, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) = 0; diff --git a/src/mongo/db/commands/apply_ops_cmd.cpp b/src/mongo/db/commands/apply_ops_cmd.cpp index 233fcc744e3..fed2ae7e2ee 100644 --- a/src/mongo/db/commands/apply_ops_cmd.cpp +++ b/src/mongo/db/commands/apply_ops_cmd.cpp @@ -89,7 +89,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { validateApplyOpsCommand(cmdObj); diff --git a/src/mongo/db/commands/authentication_commands.cpp b/src/mongo/db/commands/authentication_commands.cpp index 95a92d89e3a..3d6b07d9754 100644 --- a/src/mongo/db/commands/authentication_commands.cpp +++ b/src/mongo/db/commands/authentication_commands.cpp @@ -116,7 +116,6 @@ public: bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { nonce64 n = getNextNonce(); @@ -154,7 +153,6 @@ void CmdAuthenticate::redactForLogging(mutablebson::Document* cmdObj) { bool CmdAuthenticate::run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { if (!serverGlobalParams.quiet.load()) { @@ -377,7 +375,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { AuthorizationSession* authSession = AuthorizationSession::get(Client::getCurrent()); diff --git a/src/mongo/db/commands/authentication_commands.h b/src/mongo/db/commands/authentication_commands.h index fddfcfdb1eb..e49c214091c 100644 --- a/src/mongo/db/commands/authentication_commands.h +++ b/src/mongo/db/commands/authentication_commands.h @@ -58,7 +58,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result); diff --git a/src/mongo/db/commands/clone.cpp b/src/mongo/db/commands/clone.cpp index e5979d6d41b..68674aead43 100644 --- a/src/mongo/db/commands/clone.cpp +++ b/src/mongo/db/commands/clone.cpp @@ -90,7 +90,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { boost::optional<DisableDocumentValidation> maybeDisableValidation; diff --git a/src/mongo/db/commands/clone_collection.cpp b/src/mongo/db/commands/clone_collection.cpp index d920ac62c05..f8aeb131026 100644 --- a/src/mongo/db/commands/clone_collection.cpp +++ b/src/mongo/db/commands/clone_collection.cpp @@ -106,7 +106,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { boost::optional<DisableDocumentValidation> maybeDisableValidation; diff --git a/src/mongo/db/commands/collection_to_capped.cpp b/src/mongo/db/commands/collection_to_capped.cpp index 121d7d0a04a..62fab6dfe69 100644 --- a/src/mongo/db/commands/collection_to_capped.cpp +++ b/src/mongo/db/commands/collection_to_capped.cpp @@ -87,7 +87,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& jsobj, - int, string& errmsg, BSONObjBuilder& result) { const auto fromElt = jsobj["cloneCollectionAsCapped"]; @@ -172,7 +171,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& jsobj, - int, string& errmsg, BSONObjBuilder& result) { const NamespaceString nss(parseNsCollectionRequired(dbname, jsobj)); diff --git a/src/mongo/db/commands/compact.cpp b/src/mongo/db/commands/compact.cpp index c4e7a0e7cfd..bd408337cc5 100644 --- a/src/mongo/db/commands/compact.cpp +++ b/src/mongo/db/commands/compact.cpp @@ -89,7 +89,6 @@ public: virtual bool run(OperationContext* opCtx, const string& db, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { NamespaceString nss = parseNsCollectionRequired(db, cmdObj); diff --git a/src/mongo/db/commands/conn_pool_stats.cpp b/src/mongo/db/commands/conn_pool_stats.cpp index 1d23df5060d..c3700b839bf 100644 --- a/src/mongo/db/commands/conn_pool_stats.cpp +++ b/src/mongo/db/commands/conn_pool_stats.cpp @@ -72,7 +72,6 @@ public: bool run(OperationContext* opCtx, const std::string&, mongo::BSONObj&, - int, std::string&, mongo::BSONObjBuilder& result) override { executor::ConnectionPoolStats stats{}; diff --git a/src/mongo/db/commands/conn_pool_sync.cpp b/src/mongo/db/commands/conn_pool_sync.cpp index e3318079efd..84ba902d4ac 100644 --- a/src/mongo/db/commands/conn_pool_sync.cpp +++ b/src/mongo/db/commands/conn_pool_sync.cpp @@ -57,7 +57,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string&, mongo::BSONObj&, - int, std::string&, mongo::BSONObjBuilder& result) { shardConnectionPool.flush(); diff --git a/src/mongo/db/commands/connection_status.cpp b/src/mongo/db/commands/connection_status.cpp index 651a84327fa..c21d1427414 100644 --- a/src/mongo/db/commands/connection_status.cpp +++ b/src/mongo/db/commands/connection_status.cpp @@ -58,7 +58,6 @@ public: bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { AuthorizationSession* authSession = AuthorizationSession::get(Client::getCurrent()); diff --git a/src/mongo/db/commands/copydb.cpp b/src/mongo/db/commands/copydb.cpp index b665bcefb12..88ef6540e02 100644 --- a/src/mongo/db/commands/copydb.cpp +++ b/src/mongo/db/commands/copydb.cpp @@ -118,7 +118,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { boost::optional<DisableDocumentValidation> maybeDisableValidation; diff --git a/src/mongo/db/commands/copydb_start_commands.cpp b/src/mongo/db/commands/copydb_start_commands.cpp index f7a8949ca42..e028431cf71 100644 --- a/src/mongo/db/commands/copydb_start_commands.cpp +++ b/src/mongo/db/commands/copydb_start_commands.cpp @@ -99,7 +99,6 @@ public: virtual bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { string fromhost = cmdObj.getStringField("fromhost"); @@ -173,7 +172,6 @@ public: virtual bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { const auto fromdbElt = cmdObj["fromdb"]; diff --git a/src/mongo/db/commands/count_cmd.cpp b/src/mongo/db/commands/count_cmd.cpp index e5c7827ae0e..3b61e081ab4 100644 --- a/src/mongo/db/commands/count_cmd.cpp +++ b/src/mongo/db/commands/count_cmd.cpp @@ -168,7 +168,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { const bool isExplain = false; @@ -200,7 +199,7 @@ public: BSONObjBuilder aggResult; (void)Command::findCommand("aggregate") - ->run(opCtx, dbname, viewAggregation.getValue(), options, errmsg, aggResult); + ->run(opCtx, dbname, viewAggregation.getValue(), errmsg, aggResult); if (ResolvedView::isResolvedViewErrorResponse(aggResult.asTempObj())) { result.appendElements(aggResult.obj()); diff --git a/src/mongo/db/commands/cpuprofile.cpp b/src/mongo/db/commands/cpuprofile.cpp index 00cddd59397..8f9c16901fe 100644 --- a/src/mongo/db/commands/cpuprofile.cpp +++ b/src/mongo/db/commands/cpuprofile.cpp @@ -106,7 +106,6 @@ public: virtual bool run(OperationContext* opCtx, std::string const& db, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result); @@ -123,7 +122,6 @@ public: virtual bool run(OperationContext* opCtx, std::string const& db, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result); @@ -136,7 +134,6 @@ char const* const CpuProfilerStopCommand::commandName = "_cpuProfilerStop"; bool CpuProfilerStartCommand::run(OperationContext* opCtx, std::string const& db, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { // The DB lock here is just so we have IX on the global lock in order to prevent shutdown @@ -154,7 +151,6 @@ bool CpuProfilerStartCommand::run(OperationContext* opCtx, bool CpuProfilerStopCommand::run(OperationContext* opCtx, std::string const& db, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { // The DB lock here is just so we have IX on the global lock in order to prevent shutdown diff --git a/src/mongo/db/commands/create_indexes.cpp b/src/mongo/db/commands/create_indexes.cpp index 8dfca9ed9cc..56d3fe56594 100644 --- a/src/mongo/db/commands/create_indexes.cpp +++ b/src/mongo/db/commands/create_indexes.cpp @@ -228,7 +228,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { const NamespaceString ns(parseNsCollectionRequired(dbname, cmdObj)); diff --git a/src/mongo/db/commands/current_op.cpp b/src/mongo/db/commands/current_op.cpp index ebb4c15d207..0467e69b81a 100644 --- a/src/mongo/db/commands/current_op.cpp +++ b/src/mongo/db/commands/current_op.cpp @@ -88,7 +88,6 @@ public: bool run(OperationContext* opCtx, const std::string& db, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) final { const bool includeAll = cmdObj["$all"].trueValue(); diff --git a/src/mongo/db/commands/dbcommands.cpp b/src/mongo/db/commands/dbcommands.cpp index 6213d6a64ac..ebd5ca79cb7 100644 --- a/src/mongo/db/commands/dbcommands.cpp +++ b/src/mongo/db/commands/dbcommands.cpp @@ -363,7 +363,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { bool force = cmdObj.hasField("force") && cmdObj["force"].trueValue(); @@ -413,7 +412,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { // disallow dropping the config database @@ -482,7 +480,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { BSONElement e = cmdObj.firstElement(); @@ -586,7 +583,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { BSONElement firstElement = cmdObj.firstElement(); @@ -669,7 +665,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { const char* deprecationWarning = @@ -727,7 +722,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { const NamespaceString nsToDrop = parseNsCollectionRequired(dbname, cmdObj); @@ -779,7 +773,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { const NamespaceString ns(parseNsCollectionRequired(dbname, cmdObj)); @@ -921,7 +914,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& jsobj, - int, string& errmsg, BSONObjBuilder& result) { const NamespaceString nss(parseNs(dbname, jsobj)); @@ -1103,7 +1095,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& jsobj, - int, string& errmsg, BSONObjBuilder& result) { Timer timer; @@ -1248,7 +1239,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& jsobj, - int, string& errmsg, BSONObjBuilder& result) { const NamespaceString nss(parseNsCollectionRequired(dbname, jsobj)); @@ -1297,7 +1287,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& jsobj, - int, string& errmsg, BSONObjBuilder& result) { const NamespaceString nss(parseNsCollectionRequired(dbname, jsobj)); @@ -1333,7 +1322,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& jsobj, - int, string& errmsg, BSONObjBuilder& result) { int scale = 1; @@ -1418,7 +1406,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { result << "you" << opCtx->getClient()->clientAddress(true /*includePort*/); @@ -1445,7 +1432,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { result << "options" << QueryOption_AllSupported; @@ -1610,7 +1596,7 @@ bool Command::run(OperationContext* opCtx, } // TODO: remove queryOptions parameter from command's run method. - result = run(opCtx, db, cmd, 0, errmsg, inPlaceReplyBob); + result = run(opCtx, db, cmd, errmsg, inPlaceReplyBob); } else { auto wcResult = extractWriteConcern(opCtx, cmd, db); if (!wcResult.isOK()) { @@ -1625,7 +1611,7 @@ bool Command::run(OperationContext* opCtx, ON_BLOCK_EXIT([&] { opCtx->setWriteConcern(oldWC); }); opCtx->setWriteConcern(wcResult.getValue()); - result = run(opCtx, db, cmd, 0, errmsg, inPlaceReplyBob); + result = run(opCtx, db, cmd, errmsg, inPlaceReplyBob); // Nothing in run() should change the writeConcern. dassert(SimpleBSONObjComparator::kInstance.evaluate(opCtx->getWriteConcern().toBSON() == diff --git a/src/mongo/db/commands/dbhash.cpp b/src/mongo/db/commands/dbhash.cpp index 14800eff3d2..ea41c959bb2 100644 --- a/src/mongo/db/commands/dbhash.cpp +++ b/src/mongo/db/commands/dbhash.cpp @@ -83,7 +83,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { Timer timer; diff --git a/src/mongo/db/commands/distinct.cpp b/src/mongo/db/commands/distinct.cpp index fee7ac17c58..6b67bd840c1 100644 --- a/src/mongo/db/commands/distinct.cpp +++ b/src/mongo/db/commands/distinct.cpp @@ -168,7 +168,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { const NamespaceString nss(parseNsCollectionRequired(dbname, cmdObj)); @@ -202,7 +201,7 @@ public: BSONObjBuilder aggResult; (void)Command::findCommand("aggregate") - ->run(opCtx, dbname, viewAggregation.getValue(), options, errmsg, aggResult); + ->run(opCtx, dbname, viewAggregation.getValue(), errmsg, aggResult); if (ResolvedView::isResolvedViewErrorResponse(aggResult.asTempObj())) { result.appendElements(aggResult.obj()); diff --git a/src/mongo/db/commands/driverHelpers.cpp b/src/mongo/db/commands/driverHelpers.cpp index c25887bf0a2..994eb54605c 100644 --- a/src/mongo/db/commands/driverHelpers.cpp +++ b/src/mongo/db/commands/driverHelpers.cpp @@ -76,7 +76,6 @@ public: virtual bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { if (cmdObj.firstElement().type() != jstOID) { diff --git a/src/mongo/db/commands/drop_indexes.cpp b/src/mongo/db/commands/drop_indexes.cpp index a187de7b4bc..12ccc5408f9 100644 --- a/src/mongo/db/commands/drop_indexes.cpp +++ b/src/mongo/db/commands/drop_indexes.cpp @@ -87,7 +87,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& jsobj, - int, string& errmsg, BSONObjBuilder& result) { const NamespaceString nss = parseNsCollectionRequired(dbname, jsobj); @@ -119,7 +118,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& jsobj, - int, string& errmsg, BSONObjBuilder& result) { DBDirectClient db(opCtx); diff --git a/src/mongo/db/commands/eval.cpp b/src/mongo/db/commands/eval.cpp index cec1369e4ad..fd9cb29f940 100644 --- a/src/mongo/db/commands/eval.cpp +++ b/src/mongo/db/commands/eval.cpp @@ -174,7 +174,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { if (cmdObj["nolock"].trueValue()) { diff --git a/src/mongo/db/commands/explain_cmd.cpp b/src/mongo/db/commands/explain_cmd.cpp index 1f431ec6f6e..948cd8dd530 100644 --- a/src/mongo/db/commands/explain_cmd.cpp +++ b/src/mongo/db/commands/explain_cmd.cpp @@ -111,7 +111,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/db/commands/fail_point_cmd.cpp b/src/mongo/db/commands/fail_point_cmd.cpp index 9e6795e9d78..0f75d8c1316 100644 --- a/src/mongo/db/commands/fail_point_cmd.cpp +++ b/src/mongo/db/commands/fail_point_cmd.cpp @@ -93,7 +93,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { const string failPointName(cmdObj.firstElement().str()); diff --git a/src/mongo/db/commands/find_and_modify.cpp b/src/mongo/db/commands/find_and_modify.cpp index c4a54ddf3c4..ce8ceb39fee 100644 --- a/src/mongo/db/commands/find_and_modify.cpp +++ b/src/mongo/db/commands/find_and_modify.cpp @@ -339,7 +339,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbName, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { // findAndModify command is not replicated directly. diff --git a/src/mongo/db/commands/find_cmd.cpp b/src/mongo/db/commands/find_cmd.cpp index 30620833db1..5cb37781525 100644 --- a/src/mongo/db/commands/find_cmd.cpp +++ b/src/mongo/db/commands/find_cmd.cpp @@ -230,7 +230,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)); @@ -312,7 +311,7 @@ public: Command* agg = Command::findCommand("aggregate"); try { - agg->run(opCtx, dbname, viewAggregationCommand.getValue(), options, errmsg, result); + agg->run(opCtx, dbname, viewAggregationCommand.getValue(), errmsg, result); } catch (DBException& error) { if (error.getCode() == ErrorCodes::InvalidPipelineOperator) { return appendCommandStatus( diff --git a/src/mongo/db/commands/fsync.cpp b/src/mongo/db/commands/fsync.cpp index 1cae66a6b5f..1a9b7628503 100644 --- a/src/mongo/db/commands/fsync.cpp +++ b/src/mongo/db/commands/fsync.cpp @@ -120,7 +120,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { if (opCtx->lockState()->isLocked()) { @@ -294,7 +293,6 @@ public: bool run(OperationContext* opCtx, const std::string& db, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { log() << "command: unlock requested"; diff --git a/src/mongo/db/commands/generic.cpp b/src/mongo/db/commands/generic.cpp index 089f417a27c..082128ebf74 100644 --- a/src/mongo/db/commands/generic.cpp +++ b/src/mongo/db/commands/generic.cpp @@ -92,7 +92,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& jsobj, - int, // options std::string& errmsg, BSONObjBuilder& result) { VersionInfoInterface::instance().appendBuildInfo(&result); @@ -122,7 +121,6 @@ public: virtual bool run(OperationContext* opCtx, const string& badns, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { // IMPORTANT: Don't put anything in here that might lock db - including authentication @@ -148,7 +146,6 @@ public: virtual bool run(OperationContext* opCtx, const string& ns, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { if (getGlobalScriptEngine()) { @@ -191,7 +188,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { ProcessInfo p; @@ -239,7 +235,6 @@ public: virtual bool run(OperationContext* opCtx, const string& ns, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { bool didRotate = rotateLogs(serverGlobalParams.logRenameOnRotate); @@ -271,7 +266,6 @@ public: virtual bool run(OperationContext* opCtx, const string& ns, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { // sort the commands before building the result BSON @@ -370,7 +364,6 @@ public: bool run(OperationContext* opCtx, const string& dbnamne, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { LastError::get(cc()).setLastError(10038, "forced error"); @@ -405,7 +398,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { BSONElement val = cmdObj.firstElement(); @@ -477,7 +469,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { std::string logName; @@ -530,7 +521,6 @@ public: virtual bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { result.append("argv", serverGlobalParams.argvArray); diff --git a/src/mongo/db/commands/geo_near_cmd.cpp b/src/mongo/db/commands/geo_near_cmd.cpp index 8345c82c9fb..340cd80bd0e 100644 --- a/src/mongo/db/commands/geo_near_cmd.cpp +++ b/src/mongo/db/commands/geo_near_cmd.cpp @@ -102,7 +102,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { if (!cmdObj["start"].eoo()) { diff --git a/src/mongo/db/commands/get_last_error.cpp b/src/mongo/db/commands/get_last_error.cpp index c5d8ff9b519..14e9c4fbf33 100644 --- a/src/mongo/db/commands/get_last_error.cpp +++ b/src/mongo/db/commands/get_last_error.cpp @@ -73,7 +73,6 @@ public: bool run(OperationContext* opCtx, const string& db, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { LastError::get(opCtx->getClient()).reset(); @@ -107,7 +106,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { // @@ -316,7 +314,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { LastError* le = &LastError::get(opCtx->getClient()); diff --git a/src/mongo/db/commands/getmore_cmd.cpp b/src/mongo/db/commands/getmore_cmd.cpp index 72e3ec5db34..2f69dc7b905 100644 --- a/src/mongo/db/commands/getmore_cmd.cpp +++ b/src/mongo/db/commands/getmore_cmd.cpp @@ -448,7 +448,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { // Counted as a getMore, not as a command. diff --git a/src/mongo/db/commands/group_cmd.cpp b/src/mongo/db/commands/group_cmd.cpp index 4b41fc9e42c..b2d1735c06b 100644 --- a/src/mongo/db/commands/group_cmd.cpp +++ b/src/mongo/db/commands/group_cmd.cpp @@ -152,7 +152,6 @@ private: virtual bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { RARELY { diff --git a/src/mongo/db/commands/hashcmd.cpp b/src/mongo/db/commands/hashcmd.cpp index f7e54703898..b47b2352650 100644 --- a/src/mongo/db/commands/hashcmd.cpp +++ b/src/mongo/db/commands/hashcmd.cpp @@ -82,7 +82,6 @@ public: bool run(OperationContext* opCtx, const string& db, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { result.appendAs(cmdObj.firstElement(), "key"); diff --git a/src/mongo/db/commands/haystack.cpp b/src/mongo/db/commands/haystack.cpp index f9a41f0ccd2..77270437ff7 100644 --- a/src/mongo/db/commands/haystack.cpp +++ b/src/mongo/db/commands/haystack.cpp @@ -98,7 +98,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { const NamespaceString nss = parseNsCollectionRequired(dbname, cmdObj); diff --git a/src/mongo/db/commands/index_filter_commands.cpp b/src/mongo/db/commands/index_filter_commands.cpp index d85565ab49c..101294e4dde 100644 --- a/src/mongo/db/commands/index_filter_commands.cpp +++ b/src/mongo/db/commands/index_filter_commands.cpp @@ -118,7 +118,6 @@ IndexFilterCommand::IndexFilterCommand(const string& name, const string& helpTex bool IndexFilterCommand::run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { const NamespaceString nss(parseNsCollectionRequired(dbname, cmdObj)); diff --git a/src/mongo/db/commands/index_filter_commands.h b/src/mongo/db/commands/index_filter_commands.h index 1fada8269a5..9cedd30f765 100644 --- a/src/mongo/db/commands/index_filter_commands.h +++ b/src/mongo/db/commands/index_filter_commands.h @@ -66,7 +66,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result); diff --git a/src/mongo/db/commands/isself.cpp b/src/mongo/db/commands/isself.cpp index 6e8c1509b5f..bb1a023c7b5 100644 --- a/src/mongo/db/commands/isself.cpp +++ b/src/mongo/db/commands/isself.cpp @@ -57,7 +57,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { result.append("id", repl::instanceId); diff --git a/src/mongo/db/commands/kill_op.cpp b/src/mongo/db/commands/kill_op.cpp index 1d16113ca93..f76159b0adf 100644 --- a/src/mongo/db/commands/kill_op.cpp +++ b/src/mongo/db/commands/kill_op.cpp @@ -131,7 +131,6 @@ public: bool run(OperationContext* opCtx, const std::string& db, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) final { long long opId = parseOpId(cmdObj); diff --git a/src/mongo/db/commands/killcursors_common.cpp b/src/mongo/db/commands/killcursors_common.cpp index 570c1e1df0e..b20aeb3f734 100644 --- a/src/mongo/db/commands/killcursors_common.cpp +++ b/src/mongo/db/commands/killcursors_common.cpp @@ -66,7 +66,6 @@ Status KillCursorsCmdBase::checkAuthForCommand(Client* client, bool KillCursorsCmdBase::run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { auto statusWithRequest = KillCursorsRequest::parseFromBSON(dbname, cmdObj); diff --git a/src/mongo/db/commands/killcursors_common.h b/src/mongo/db/commands/killcursors_common.h index c5b6e9db31d..8d4bcf07c75 100644 --- a/src/mongo/db/commands/killcursors_common.h +++ b/src/mongo/db/commands/killcursors_common.h @@ -73,7 +73,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) final; diff --git a/src/mongo/db/commands/list_collections.cpp b/src/mongo/db/commands/list_collections.cpp index e5b959296f1..5610a67ad66 100644 --- a/src/mongo/db/commands/list_collections.cpp +++ b/src/mongo/db/commands/list_collections.cpp @@ -227,7 +227,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& jsobj, - int, string& errmsg, BSONObjBuilder& result) { unique_ptr<MatchExpression> matcher; diff --git a/src/mongo/db/commands/list_databases.cpp b/src/mongo/db/commands/list_databases.cpp index ffe00a55362..4b3be3b27db 100644 --- a/src/mongo/db/commands/list_databases.cpp +++ b/src/mongo/db/commands/list_databases.cpp @@ -86,7 +86,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& jsobj, - int, string& errmsg, BSONObjBuilder& result) { // Parse the filter. diff --git a/src/mongo/db/commands/list_indexes.cpp b/src/mongo/db/commands/list_indexes.cpp index 7ef1f599828..387cb7a376d 100644 --- a/src/mongo/db/commands/list_indexes.cpp +++ b/src/mongo/db/commands/list_indexes.cpp @@ -119,7 +119,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { const NamespaceString ns(parseNsCollectionRequired(dbname, cmdObj)); diff --git a/src/mongo/db/commands/lock_info.cpp b/src/mongo/db/commands/lock_info.cpp index 69dd15a6c0b..1a118b80fc3 100644 --- a/src/mongo/db/commands/lock_info.cpp +++ b/src/mongo/db/commands/lock_info.cpp @@ -82,7 +82,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& jsobj, - int, string& errmsg, BSONObjBuilder& result) { std::map<LockerId, BSONObj> lockToClientMap; diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp index dbff7942c96..f6338b0a2a7 100644 --- a/src/mongo/db/commands/mr.cpp +++ b/src/mongo/db/commands/mr.cpp @@ -1362,7 +1362,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmd, - int, string& errmsg, BSONObjBuilder& result) { Timer t; @@ -1716,7 +1715,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { if (serverGlobalParams.clusterRole == ClusterRole::ConfigServer) { diff --git a/src/mongo/db/commands/oplog_note.cpp b/src/mongo/db/commands/oplog_note.cpp index fd6083a6a89..abdd78901c9 100644 --- a/src/mongo/db/commands/oplog_note.cpp +++ b/src/mongo/db/commands/oplog_note.cpp @@ -116,7 +116,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { BSONElement dataElement; diff --git a/src/mongo/db/commands/parallel_collection_scan.cpp b/src/mongo/db/commands/parallel_collection_scan.cpp index c5166658105..725e76b19ab 100644 --- a/src/mongo/db/commands/parallel_collection_scan.cpp +++ b/src/mongo/db/commands/parallel_collection_scan.cpp @@ -88,7 +88,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { const NamespaceString ns(parseNsCollectionRequired(dbname, cmdObj)); diff --git a/src/mongo/db/commands/parameters.cpp b/src/mongo/db/commands/parameters.cpp index c908edb3390..785375c514f 100644 --- a/src/mongo/db/commands/parameters.cpp +++ b/src/mongo/db/commands/parameters.cpp @@ -91,7 +91,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { bool all = *cmdObj.firstElement().valuestrsafe() == '*'; @@ -140,7 +139,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { int numSet = 0; diff --git a/src/mongo/db/commands/pipeline_command.cpp b/src/mongo/db/commands/pipeline_command.cpp index 47db0e450c6..af863000b60 100644 --- a/src/mongo/db/commands/pipeline_command.cpp +++ b/src/mongo/db/commands/pipeline_command.cpp @@ -93,7 +93,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& db, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { const NamespaceString nss(parseNsCollectionRequired(db, cmdObj)); diff --git a/src/mongo/db/commands/plan_cache_commands.cpp b/src/mongo/db/commands/plan_cache_commands.cpp index bb4eebcb998..f194d17129e 100644 --- a/src/mongo/db/commands/plan_cache_commands.cpp +++ b/src/mongo/db/commands/plan_cache_commands.cpp @@ -113,7 +113,6 @@ PlanCacheCommand::PlanCacheCommand(const string& name, bool PlanCacheCommand::run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { const NamespaceString nss(parseNsCollectionRequired(dbname, cmdObj)); diff --git a/src/mongo/db/commands/plan_cache_commands.h b/src/mongo/db/commands/plan_cache_commands.h index 881bf475433..7b3da100782 100644 --- a/src/mongo/db/commands/plan_cache_commands.h +++ b/src/mongo/db/commands/plan_cache_commands.h @@ -60,7 +60,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result); diff --git a/src/mongo/db/commands/rename_collection_cmd.cpp b/src/mongo/db/commands/rename_collection_cmd.cpp index 6aaa3b5f744..8a2afb4da64 100644 --- a/src/mongo/db/commands/rename_collection_cmd.cpp +++ b/src/mongo/db/commands/rename_collection_cmd.cpp @@ -88,7 +88,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { const auto sourceNsElt = cmdObj[getName()]; diff --git a/src/mongo/db/commands/repair_cursor.cpp b/src/mongo/db/commands/repair_cursor.cpp index 1390b0281b3..bf45608ccff 100644 --- a/src/mongo/db/commands/repair_cursor.cpp +++ b/src/mongo/db/commands/repair_cursor.cpp @@ -70,7 +70,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { NamespaceString ns(parseNs(dbname, cmdObj)); diff --git a/src/mongo/db/commands/server_status.cpp b/src/mongo/db/commands/server_status.cpp index fd429ed21b1..6fa1f9d56c7 100644 --- a/src/mongo/db/commands/server_status.cpp +++ b/src/mongo/db/commands/server_status.cpp @@ -88,7 +88,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { _runCalled = true; diff --git a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp index 6e173143efc..10234b925ba 100644 --- a/src/mongo/db/commands/set_feature_compatibility_version_command.cpp +++ b/src/mongo/db/commands/set_feature_compatibility_version_command.cpp @@ -84,7 +84,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/db/commands/snapshot_management.cpp b/src/mongo/db/commands/snapshot_management.cpp index 1eb6e2c2126..05782177b9e 100644 --- a/src/mongo/db/commands/snapshot_management.cpp +++ b/src/mongo/db/commands/snapshot_management.cpp @@ -67,7 +67,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int, std::string& errmsg, BSONObjBuilder& result) { auto snapshotManager = @@ -117,7 +116,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int, std::string& errmsg, BSONObjBuilder& result) { auto snapshotManager = diff --git a/src/mongo/db/commands/test_commands.cpp b/src/mongo/db/commands/test_commands.cpp index 17596a13e18..0c12a8c22ce 100644 --- a/src/mongo/db/commands/test_commands.cpp +++ b/src/mongo/db/commands/test_commands.cpp @@ -78,7 +78,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { const NamespaceString nss(parseNsCollectionRequired(dbname, cmdObj)); @@ -153,7 +152,6 @@ public: bool run(OperationContext* opCtx, const string& ns, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { log() << "test only command sleep invoked"; @@ -217,7 +215,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { const NamespaceString fullNs = parseNsCollectionRequired(dbname, cmdObj); @@ -298,7 +295,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { const NamespaceString nss = parseNsCollectionRequired(dbname, cmdObj); diff --git a/src/mongo/db/commands/top_command.cpp b/src/mongo/db/commands/top_command.cpp index 80ef9171efd..0837e9a2d92 100644 --- a/src/mongo/db/commands/top_command.cpp +++ b/src/mongo/db/commands/top_command.cpp @@ -68,7 +68,6 @@ public: virtual bool run(OperationContext* opCtx, const std::string& db, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { { diff --git a/src/mongo/db/commands/touch.cpp b/src/mongo/db/commands/touch.cpp index 7cae0f979ee..18c99460650 100644 --- a/src/mongo/db/commands/touch.cpp +++ b/src/mongo/db/commands/touch.cpp @@ -85,7 +85,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { const NamespaceString nss = parseNsCollectionRequired(dbname, cmdObj); diff --git a/src/mongo/db/commands/user_management_commands.cpp b/src/mongo/db/commands/user_management_commands.cpp index b6a55727c80..854a8be669f 100644 --- a/src/mongo/db/commands/user_management_commands.cpp +++ b/src/mongo/db/commands/user_management_commands.cpp @@ -618,7 +618,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { auth::CreateOrUpdateUserArgs args; @@ -764,7 +763,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { auth::CreateOrUpdateUserArgs args; @@ -882,7 +880,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { UserName userName; @@ -951,7 +948,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { Status status = auth::parseAndValidateDropAllUsersFromDatabaseCommand(cmdObj, dbname); @@ -1009,7 +1005,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { std::string userNameString; @@ -1084,7 +1079,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { std::string userNameString; @@ -1163,7 +1157,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { auth::UsersInfoArgs args; @@ -1274,7 +1267,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { auth::CreateOrUpdateRoleArgs args; @@ -1388,7 +1380,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { auth::CreateOrUpdateRoleArgs args; @@ -1487,7 +1478,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { @@ -1596,7 +1586,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { RoleName roleName; @@ -1707,7 +1696,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { std::string roleNameString; @@ -1799,7 +1787,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { std::string roleNameString; @@ -1890,7 +1877,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { RoleName roleName; @@ -2045,7 +2031,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { Status status = auth::parseDropAllRolesFromDatabaseCommand(cmdObj, dbname); @@ -2189,7 +2174,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { auth::RolesInfoArgs args; @@ -2271,7 +2255,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { AuthorizationManager* authzManager = getGlobalAuthorizationManager(); @@ -2310,7 +2293,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { AuthorizationManager* authzManager = getGlobalAuthorizationManager(); @@ -2688,7 +2670,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { auth::MergeAuthzCollectionsArgs args; @@ -2930,7 +2911,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { auth::AuthSchemaUpgradeArgs parsedArgs; diff --git a/src/mongo/db/commands/validate.cpp b/src/mongo/db/commands/validate.cpp index b9387523e30..11a0806fbf9 100644 --- a/src/mongo/db/commands/validate.cpp +++ b/src/mongo/db/commands/validate.cpp @@ -78,7 +78,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { if (MONGO_FAIL_POINT(validateCmdCollectionNotValid)) { diff --git a/src/mongo/db/commands/write_commands/write_commands.cpp b/src/mongo/db/commands/write_commands/write_commands.cpp index b6896022583..905a93f0eb6 100644 --- a/src/mongo/db/commands/write_commands/write_commands.cpp +++ b/src/mongo/db/commands/write_commands/write_commands.cpp @@ -210,7 +210,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) final { try { diff --git a/src/mongo/db/dbdirectclient.cpp b/src/mongo/db/dbdirectclient.cpp index 90d511716c8..5b1499da351 100644 --- a/src/mongo/db/dbdirectclient.cpp +++ b/src/mongo/db/dbdirectclient.cpp @@ -164,7 +164,7 @@ unsigned long long DBDirectClient::count( std::string errmsg; BSONObjBuilder result; - bool runRetval = countCmd->run(_opCtx, dbname, cmdObj, options, errmsg, result); + bool runRetval = countCmd->run(_opCtx, dbname, cmdObj, errmsg, result); if (!runRetval) { Command::appendCommandStatus(result, runRetval, errmsg); Status commandStatus = getStatusFromCommandResult(result.obj()); diff --git a/src/mongo/db/dbwebserver.cpp b/src/mongo/db/dbwebserver.cpp index 34b06d1f784..361c51ca05f 100644 --- a/src/mongo/db/dbwebserver.cpp +++ b/src/mongo/db/dbwebserver.cpp @@ -231,7 +231,7 @@ public: string errmsg; BSONObjBuilder sub; - if (!c->run(opCtx, "admin.$cmd", co, 0, errmsg, sub)) + if (!c->run(opCtx, "admin.$cmd", co, errmsg, sub)) buf.append(cmd, errmsg); else buf.append(cmd, sub.obj()); diff --git a/src/mongo/db/exec/stagedebug_cmd.cpp b/src/mongo/db/exec/stagedebug_cmd.cpp index 82642010760..0cd1f5d7a42 100644 --- a/src/mongo/db/exec/stagedebug_cmd.cpp +++ b/src/mongo/db/exec/stagedebug_cmd.cpp @@ -140,7 +140,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { BSONElement argElt = cmdObj["stageDebug"]; diff --git a/src/mongo/db/ftdc/ftdc_commands.cpp b/src/mongo/db/ftdc/ftdc_commands.cpp index e50f5d9cf71..23202624b60 100644 --- a/src/mongo/db/ftdc/ftdc_commands.cpp +++ b/src/mongo/db/ftdc/ftdc_commands.cpp @@ -91,7 +91,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/db/ftdc/ftdc_mongod.cpp b/src/mongo/db/ftdc/ftdc_mongod.cpp index e80fd8a20b9..f8aa05c092e 100644 --- a/src/mongo/db/ftdc/ftdc_mongod.cpp +++ b/src/mongo/db/ftdc/ftdc_mongod.cpp @@ -259,7 +259,7 @@ public: void collect(OperationContext* opCtx, BSONObjBuilder& builder) override { std::string errmsg; - bool ret = _command->run(opCtx, _ns, _cmdObj, 0, errmsg, builder); + bool ret = _command->run(opCtx, _ns, _cmdObj, errmsg, builder); // Some commands return errmsgs when they return false (collstats) // Some commands return bson objs when they return false (replGetStatus) diff --git a/src/mongo/db/repl/master_slave.cpp b/src/mongo/db/repl/master_slave.cpp index 2b26ad061c7..1c68848814b 100644 --- a/src/mongo/db/repl/master_slave.cpp +++ b/src/mongo/db/repl/master_slave.cpp @@ -387,7 +387,6 @@ public: virtual bool run(OperationContext* opCtx, const string& ns, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { HandshakeArgs handshake; diff --git a/src/mongo/db/repl/repl_set_commands.cpp b/src/mongo/db/repl/repl_set_commands.cpp index 2429351c364..48969d39a3b 100644 --- a/src/mongo/db/repl/repl_set_commands.cpp +++ b/src/mongo/db/repl/repl_set_commands.cpp @@ -96,7 +96,6 @@ public: virtual bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { log() << "replSetTest command received: " << cmdObj.toString(); @@ -165,7 +164,6 @@ public: virtual bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { Status status = getGlobalReplicationCoordinator()->checkReplEnabledForCommand(&result); @@ -188,7 +186,6 @@ public: virtual bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { if (cmdObj["forShell"].trueValue()) @@ -230,7 +227,6 @@ public: virtual bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { Status status = getGlobalReplicationCoordinator()->checkReplEnabledForCommand(&result); @@ -330,7 +326,6 @@ public: virtual bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { BSONObj configObj; @@ -405,7 +400,6 @@ public: virtual bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { Status status = getGlobalReplicationCoordinator()->checkReplEnabledForCommand(&result); @@ -462,7 +456,6 @@ public: virtual bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { Status status = getGlobalReplicationCoordinator()->checkReplEnabledForCommand(&result); @@ -494,7 +487,6 @@ public: virtual bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { Status status = getGlobalReplicationCoordinator()->checkReplEnabledForCommand(&result); @@ -560,7 +552,6 @@ public: virtual bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { Status status = getGlobalReplicationCoordinator()->checkReplEnabledForCommand(&result); @@ -589,7 +580,6 @@ public: virtual bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { Status status = getGlobalReplicationCoordinator()->checkReplEnabledForCommand(&result); @@ -618,7 +608,6 @@ public: virtual bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { auto replCoord = repl::ReplicationCoordinator::get(opCtx->getClient()->getServiceContext()); @@ -718,7 +707,6 @@ public: virtual bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { MONGO_FAIL_POINT_BLOCK(rsDelayHeartbeatResponse, delay) { @@ -805,7 +793,6 @@ public: virtual bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { Status status = getGlobalReplicationCoordinator()->checkReplEnabledForCommand(&result); @@ -838,7 +825,6 @@ private: virtual bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { DEV log() << "received elect msg " << cmdObj.toString(); @@ -872,7 +858,6 @@ public: virtual bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { Status status = getGlobalReplicationCoordinator()->checkReplEnabledForCommand(&result); diff --git a/src/mongo/db/repl/repl_set_request_votes.cpp b/src/mongo/db/repl/repl_set_request_votes.cpp index 5577952807d..7c9ad65950b 100644 --- a/src/mongo/db/repl/repl_set_request_votes.cpp +++ b/src/mongo/db/repl/repl_set_request_votes.cpp @@ -50,7 +50,6 @@ private: bool run(OperationContext* opCtx, const std::string&, BSONObj& cmdObj, - int, std::string& errmsg, BSONObjBuilder& result) final { Status status = getGlobalReplicationCoordinator()->checkReplEnabledForCommand(&result); diff --git a/src/mongo/db/repl/replication_info.cpp b/src/mongo/db/repl/replication_info.cpp index 28bc80d04c8..84eed6ba699 100644 --- a/src/mongo/db/repl/replication_info.cpp +++ b/src/mongo/db/repl/replication_info.cpp @@ -228,7 +228,6 @@ public: virtual bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { /* currently request to arbiter is (somewhat arbitrarily) an ismaster request that is not diff --git a/src/mongo/db/repl/resync.cpp b/src/mongo/db/repl/resync.cpp index 67b230af0af..d95ff87cc0f 100644 --- a/src/mongo/db/repl/resync.cpp +++ b/src/mongo/db/repl/resync.cpp @@ -75,7 +75,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { bool waitForResync = !cmdObj.hasField(kWaitFieldName) || cmdObj[kWaitFieldName].trueValue(); diff --git a/src/mongo/db/s/check_sharding_index_command.cpp b/src/mongo/db/s/check_sharding_index_command.cpp index 79f4b50cbc9..db6b727aa2f 100644 --- a/src/mongo/db/s/check_sharding_index_command.cpp +++ b/src/mongo/db/s/check_sharding_index_command.cpp @@ -85,7 +85,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& jsobj, - int options, std::string& errmsg, BSONObjBuilder& result) { const NamespaceString nss = NamespaceString(parseNs(dbname, jsobj)); diff --git a/src/mongo/db/s/cleanup_orphaned_cmd.cpp b/src/mongo/db/s/cleanup_orphaned_cmd.cpp index d0e58779a3b..117a50b57c7 100644 --- a/src/mongo/db/s/cleanup_orphaned_cmd.cpp +++ b/src/mongo/db/s/cleanup_orphaned_cmd.cpp @@ -206,7 +206,6 @@ public: bool run(OperationContext* opCtx, string const& db, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { string ns; diff --git a/src/mongo/db/s/config/configsvr_add_shard_command.cpp b/src/mongo/db/s/config/configsvr_add_shard_command.cpp index 5cfc614a816..d6584229b25 100644 --- a/src/mongo/db/s/config/configsvr_add_shard_command.cpp +++ b/src/mongo/db/s/config/configsvr_add_shard_command.cpp @@ -89,7 +89,6 @@ public: bool run(OperationContext* opCtx, const std::string& unusedDbName, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { if (serverGlobalParams.clusterRole != ClusterRole::ConfigServer) { diff --git a/src/mongo/db/s/config/configsvr_add_shard_to_zone_command.cpp b/src/mongo/db/s/config/configsvr_add_shard_to_zone_command.cpp index 236b2409af1..0b1791846d5 100644 --- a/src/mongo/db/s/config/configsvr_add_shard_to_zone_command.cpp +++ b/src/mongo/db/s/config/configsvr_add_shard_to_zone_command.cpp @@ -90,7 +90,6 @@ public: bool run(OperationContext* opCtx, const std::string& unusedDbName, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { if (serverGlobalParams.clusterRole != ClusterRole::ConfigServer) { diff --git a/src/mongo/db/s/config/configsvr_commit_chunk_migration_command.cpp b/src/mongo/db/s/config/configsvr_commit_chunk_migration_command.cpp index 5144be21703..5da0f7f9467 100644 --- a/src/mongo/db/s/config/configsvr_commit_chunk_migration_command.cpp +++ b/src/mongo/db/s/config/configsvr_commit_chunk_migration_command.cpp @@ -120,7 +120,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbName, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { diff --git a/src/mongo/db/s/config/configsvr_control_balancer_command.cpp b/src/mongo/db/s/config/configsvr_control_balancer_command.cpp index f4905406f78..0abcd7ebd70 100644 --- a/src/mongo/db/s/config/configsvr_control_balancer_command.cpp +++ b/src/mongo/db/s/config/configsvr_control_balancer_command.cpp @@ -75,7 +75,6 @@ public: bool run(OperationContext* opCtx, const std::string& unusedDbName, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) final { uassert(ErrorCodes::InternalError, diff --git a/src/mongo/db/s/config/configsvr_merge_chunk_command.cpp b/src/mongo/db/s/config/configsvr_merge_chunk_command.cpp index 7d4dfc12b87..5d0c6a1c125 100644 --- a/src/mongo/db/s/config/configsvr_merge_chunk_command.cpp +++ b/src/mongo/db/s/config/configsvr_merge_chunk_command.cpp @@ -101,7 +101,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbName, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { if (serverGlobalParams.clusterRole != ClusterRole::ConfigServer) { diff --git a/src/mongo/db/s/config/configsvr_move_chunk_command.cpp b/src/mongo/db/s/config/configsvr_move_chunk_command.cpp index 8b4fe32025e..857dc043d0c 100644 --- a/src/mongo/db/s/config/configsvr_move_chunk_command.cpp +++ b/src/mongo/db/s/config/configsvr_move_chunk_command.cpp @@ -81,7 +81,6 @@ public: bool run(OperationContext* opCtx, const std::string& unusedDbName, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { auto request = uassertStatusOK(BalanceChunkRequest::parseFromConfigCommand(cmdObj)); diff --git a/src/mongo/db/s/config/configsvr_remove_shard_from_zone_command.cpp b/src/mongo/db/s/config/configsvr_remove_shard_from_zone_command.cpp index ae83006e471..59846797124 100644 --- a/src/mongo/db/s/config/configsvr_remove_shard_from_zone_command.cpp +++ b/src/mongo/db/s/config/configsvr_remove_shard_from_zone_command.cpp @@ -90,7 +90,6 @@ public: bool run(OperationContext* opCtx, const std::string& unusedDbName, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { if (serverGlobalParams.clusterRole != ClusterRole::ConfigServer) { diff --git a/src/mongo/db/s/config/configsvr_set_feature_compatibility_version_command.cpp b/src/mongo/db/s/config/configsvr_set_feature_compatibility_version_command.cpp index 8e1fa7825e8..daba7456ed5 100644 --- a/src/mongo/db/s/config/configsvr_set_feature_compatibility_version_command.cpp +++ b/src/mongo/db/s/config/configsvr_set_feature_compatibility_version_command.cpp @@ -84,7 +84,6 @@ public: bool run(OperationContext* opCtx, const std::string& unusedDbName, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { const auto version = uassertStatusOK( diff --git a/src/mongo/db/s/config/configsvr_split_chunk_command.cpp b/src/mongo/db/s/config/configsvr_split_chunk_command.cpp index 0b3cfe6f40d..fa425697548 100644 --- a/src/mongo/db/s/config/configsvr_split_chunk_command.cpp +++ b/src/mongo/db/s/config/configsvr_split_chunk_command.cpp @@ -99,7 +99,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbName, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { if (serverGlobalParams.clusterRole != ClusterRole::ConfigServer) { diff --git a/src/mongo/db/s/config/configsvr_update_zone_key_range_command.cpp b/src/mongo/db/s/config/configsvr_update_zone_key_range_command.cpp index 36d68576568..2e253cf489e 100644 --- a/src/mongo/db/s/config/configsvr_update_zone_key_range_command.cpp +++ b/src/mongo/db/s/config/configsvr_update_zone_key_range_command.cpp @@ -92,7 +92,6 @@ public: bool run(OperationContext* opCtx, const std::string& unusedDbName, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { if (serverGlobalParams.clusterRole != ClusterRole::ConfigServer) { diff --git a/src/mongo/db/s/get_shard_version_command.cpp b/src/mongo/db/s/get_shard_version_command.cpp index 86796a4ef50..81157fcc07a 100644 --- a/src/mongo/db/s/get_shard_version_command.cpp +++ b/src/mongo/db/s/get_shard_version_command.cpp @@ -85,7 +85,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/db/s/merge_chunks_command.cpp b/src/mongo/db/s/merge_chunks_command.cpp index 98975244838..49bc379014a 100644 --- a/src/mongo/db/s/merge_chunks_command.cpp +++ b/src/mongo/db/s/merge_chunks_command.cpp @@ -363,7 +363,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) override { uassertStatusOK(ShardingState::get(opCtx)->canAcceptShardedCommands()); diff --git a/src/mongo/db/s/migration_chunk_cloner_source_legacy_commands.cpp b/src/mongo/db/s/migration_chunk_cloner_source_legacy_commands.cpp index 955d834941d..d6cd3d89773 100644 --- a/src/mongo/db/s/migration_chunk_cloner_source_legacy_commands.cpp +++ b/src/mongo/db/s/migration_chunk_cloner_source_legacy_commands.cpp @@ -142,7 +142,6 @@ public: bool run(OperationContext* opCtx, const std::string&, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { const MigrationSessionId migrationSessionId( @@ -206,7 +205,6 @@ public: bool run(OperationContext* opCtx, const std::string&, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) { const MigrationSessionId migrationSessionId( diff --git a/src/mongo/db/s/migration_destination_manager_legacy_commands.cpp b/src/mongo/db/s/migration_destination_manager_legacy_commands.cpp index d3d54f6710c..324f67906f9 100644 --- a/src/mongo/db/s/migration_destination_manager_legacy_commands.cpp +++ b/src/mongo/db/s/migration_destination_manager_legacy_commands.cpp @@ -88,7 +88,6 @@ public: bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { auto shardingState = ShardingState::get(opCtx); @@ -202,7 +201,6 @@ public: bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { ShardingState::get(opCtx)->migrationDestinationManager()->report(result); @@ -243,7 +241,6 @@ public: bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { auto const sessionId = uassertStatusOK(MigrationSessionId::extractFromBSON(cmdObj)); @@ -291,7 +288,6 @@ public: bool run(OperationContext* opCtx, const string&, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { auto const mdm = ShardingState::get(opCtx)->migrationDestinationManager(); diff --git a/src/mongo/db/s/move_chunk_command.cpp b/src/mongo/db/s/move_chunk_command.cpp index 08ea3723920..f68ab8dde0e 100644 --- a/src/mongo/db/s/move_chunk_command.cpp +++ b/src/mongo/db/s/move_chunk_command.cpp @@ -113,7 +113,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) override { auto shardingState = ShardingState::get(opCtx); diff --git a/src/mongo/db/s/set_shard_version_command.cpp b/src/mongo/db/s/set_shard_version_command.cpp index 3b62d381b7b..e7078cea3d3 100644 --- a/src/mongo/db/s/set_shard_version_command.cpp +++ b/src/mongo/db/s/set_shard_version_command.cpp @@ -91,7 +91,6 @@ public: bool run(OperationContext* opCtx, const std::string&, BSONObj& cmdObj, - int options, string& errmsg, BSONObjBuilder& result) { auto shardingState = ShardingState::get(opCtx); diff --git a/src/mongo/db/s/sharding_state_command.cpp b/src/mongo/db/s/sharding_state_command.cpp index 86606ef3598..cf483e80c98 100644 --- a/src/mongo/db/s/sharding_state_command.cpp +++ b/src/mongo/db/s/sharding_state_command.cpp @@ -70,7 +70,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { ShardingState::get(opCtx)->appendInfo(opCtx, result); diff --git a/src/mongo/db/s/split_chunk_command.cpp b/src/mongo/db/s/split_chunk_command.cpp index 7140556d5ec..a2009bdf53b 100644 --- a/src/mongo/db/s/split_chunk_command.cpp +++ b/src/mongo/db/s/split_chunk_command.cpp @@ -170,7 +170,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { auto shardingState = ShardingState::get(opCtx); diff --git a/src/mongo/db/s/split_vector_command.cpp b/src/mongo/db/s/split_vector_command.cpp index b2dc34a6396..71bbe04e7dc 100644 --- a/src/mongo/db/s/split_vector_command.cpp +++ b/src/mongo/db/s/split_vector_command.cpp @@ -114,7 +114,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& jsobj, - int options, string& errmsg, BSONObjBuilder& result) override { // diff --git a/src/mongo/db/s/unset_sharding_command.cpp b/src/mongo/db/s/unset_sharding_command.cpp index 7155b35bce8..d64b739f621 100644 --- a/src/mongo/db/s/unset_sharding_command.cpp +++ b/src/mongo/db/s/unset_sharding_command.cpp @@ -75,7 +75,6 @@ public: bool run(OperationContext* opCtx, const std::string& dbname, BSONObj& cmdObj, - int options, std::string& errmsg, BSONObjBuilder& result) override { ShardedConnectionInfo::reset(opCtx->getClient()); diff --git a/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp b/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp index e4f5452e123..23e59a9f065 100644 --- a/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp +++ b/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp @@ -87,7 +87,6 @@ public: bool run(OperationContext* opCtx, const string& dbname, BSONObj& cmdObj, - int, string& errmsg, BSONObjBuilder& result) { boost::filesystem::path p = dur::getJournalDir(); diff --git a/src/mongo/s/client/shard_connection.cpp b/src/mongo/s/client/shard_connection.cpp index 35b537c5600..c7fe4d56f43 100644 --- a/src/mongo/s/client/shard_connection.cpp +++ b/src/mongo/s/client/shard_connection.cpp @@ -114,7 +114,6 @@ public: virtual bool run(OperationContext* opCtx, const string& dbname, mongo::BSONObj& cmdObj, - int options, std::string& errmsg, mongo::BSONObjBuilder& result) { // Connection information 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, |