summaryrefslogtreecommitdiff
path: root/src/mongo/s/commands/cluster_find_cmd.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2017-06-01 14:18:45 -0400
committerMathias Stearn <mathias@10gen.com>2017-06-13 17:15:28 -0400
commit24c66e9e8f9a2415436adf1a09317eaae8ee56e5 (patch)
tree2ff9fcd9450190882d20c9cefac9faccbbe8c783 /src/mongo/s/commands/cluster_find_cmd.cpp
parent7317ccaf069b5c2ac6d725aaf5fd3eb82bbdd45d (diff)
downloadmongo-24c66e9e8f9a2415436adf1a09317eaae8ee56e5.tar.gz
SERVER-29525 filter mongos command requests only where needed
Diffstat (limited to 'src/mongo/s/commands/cluster_find_cmd.cpp')
-rw-r--r--src/mongo/s/commands/cluster_find_cmd.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/mongo/s/commands/cluster_find_cmd.cpp b/src/mongo/s/commands/cluster_find_cmd.cpp
index 16c84ab5c27..4bf8b053008 100644
--- a/src/mongo/s/commands/cluster_find_cmd.cpp
+++ b/src/mongo/s/commands/cluster_find_cmd.cpp
@@ -171,19 +171,12 @@ public:
return appendCommandStatus(result, cq.getStatus());
}
- // Extract read preference. If no read preference is specified in the query, will we pass
- // down a "primaryOnly" or "secondary" read pref, depending on the slaveOk setting.
- auto readPref = ClusterFind::extractUnwrappedReadPref(cmdObj);
- if (!readPref.isOK()) {
- return appendCommandStatus(result, readPref.getStatus());
- }
-
// Do the work to generate the first batch of results. This blocks waiting to get responses
// from the shard(s).
std::vector<BSONObj> batch;
BSONObj viewDefinition;
auto cursorId = ClusterFind::runQuery(
- opCtx, *cq.getValue(), readPref.getValue(), &batch, &viewDefinition);
+ opCtx, *cq.getValue(), ReadPreferenceSetting::get(opCtx), &batch, &viewDefinition);
if (!cursorId.isOK()) {
if (cursorId.getStatus() == ErrorCodes::CommandOnShardedViewNotSupportedOnMongod) {
auto aggCmdOnView = cq.getValue()->getQueryRequest().asAggregationCommand();