diff options
author | Mathias Stearn <mathias@10gen.com> | 2017-04-28 17:02:37 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2017-05-12 12:07:30 -0400 |
commit | 486759fee5852abed5ee263583d6e867da9c0f5d (patch) | |
tree | 266ccf9fdfe6de8083fe0aef0350731164d4e6fc /src/mongo/s/commands/cluster_find_cmd.cpp | |
parent | cb3e9d87a1150fcfd90b7db3e289e298c5c70bff (diff) | |
download | mongo-486759fee5852abed5ee263583d6e867da9c0f5d.tar.gz |
SERVER-28814 Attach ServerSelectionMetadata to OpCtx in mongos
This eliminates the need to pass it in to Command::explain()
Diffstat (limited to 'src/mongo/s/commands/cluster_find_cmd.cpp')
-rw-r--r-- | src/mongo/s/commands/cluster_find_cmd.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mongo/s/commands/cluster_find_cmd.cpp b/src/mongo/s/commands/cluster_find_cmd.cpp index a09a839a94a..83598d92401 100644 --- a/src/mongo/s/commands/cluster_find_cmd.cpp +++ b/src/mongo/s/commands/cluster_find_cmd.cpp @@ -38,6 +38,7 @@ #include "mongo/db/stats/counters.h" #include "mongo/db/views/resolved_view.h" #include "mongo/rpc/get_status_from_command_result.h" +#include "mongo/rpc/metadata/server_selection_metadata.h" #include "mongo/s/commands/cluster_aggregate.h" #include "mongo/s/commands/strategy.h" #include "mongo/s/query/cluster_find.h" @@ -105,7 +106,6 @@ public: const std::string& dbname, const BSONObj& cmdObj, ExplainOptions::Verbosity verbosity, - const rpc::ServerSelectionMetadata& serverSelectionMetadata, BSONObjBuilder* out) const final { const NamespaceString nss(parseNsCollectionRequired(dbname, cmdObj)); // Parse the command BSON to a QueryRequest. @@ -115,8 +115,12 @@ public: return qr.getStatus(); } - auto result = Strategy::explainFind( - opCtx, cmdObj, *qr.getValue(), verbosity, serverSelectionMetadata, out); + auto result = Strategy::explainFind(opCtx, + cmdObj, + *qr.getValue(), + verbosity, + rpc::ServerSelectionMetadata::get(opCtx), + out); if (result == ErrorCodes::CommandOnShardedViewNotSupportedOnMongod) { auto resolvedView = ResolvedView::fromBSON(out->asTempObj()); |