summaryrefslogtreecommitdiff
path: root/src/mongo/s/commands/cluster_distinct_cmd.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2020-08-25 01:42:28 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-09-01 10:50:45 +0000
commit9cb82d2e8680717d3002459ba5fdb16036183a17 (patch)
tree6d49e2f6a2bba23707285e90ec1e8b3beba41400 /src/mongo/s/commands/cluster_distinct_cmd.cpp
parentca4df25002a60910b38bfdd8d71eb5bff5a79b49 (diff)
downloadmongo-9cb82d2e8680717d3002459ba5fdb16036183a17.tar.gz
SERVER-50505 Make the CatalogCache return ChunkManager(s) directly
... instead of returning the intermediate CachedCollectionRoutingInfo class. The ChunkManager should be the only class used for routing.
Diffstat (limited to 'src/mongo/s/commands/cluster_distinct_cmd.cpp')
-rw-r--r--src/mongo/s/commands/cluster_distinct_cmd.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/mongo/s/commands/cluster_distinct_cmd.cpp b/src/mongo/s/commands/cluster_distinct_cmd.cpp
index 7359c79e910..9f836644ff5 100644
--- a/src/mongo/s/commands/cluster_distinct_cmd.cpp
+++ b/src/mongo/s/commands/cluster_distinct_cmd.cpp
@@ -176,10 +176,10 @@ public:
CollatorFactoryInterface::get(opCtx->getServiceContext())->makeFromBSON(collation));
}
- const auto routingInfo = uassertStatusOK(getCollectionRoutingInfoForTxnCmd(opCtx, nss));
+ const auto cm = uassertStatusOK(getCollectionRoutingInfoForTxnCmd(opCtx, nss));
if (repl::ReadConcernArgs::get(opCtx).getLevel() ==
repl::ReadConcernLevel::kSnapshotReadConcern &&
- !opCtx->inMultiDocumentTransaction() && routingInfo.cm()) {
+ !opCtx->inMultiDocumentTransaction() && cm.isSharded()) {
uasserted(ErrorCodes::InvalidOptions,
"readConcern level \"snapshot\" prohibited for \"distinct\" command on"
" sharded collection");
@@ -191,7 +191,7 @@ public:
opCtx,
nss.db(),
nss,
- routingInfo,
+ cm,
applyReadWriteConcern(
opCtx, this, CommandHelpers::filterCommandRequestForPassthrough(cmdObj)),
ReadPreferenceSetting::get(opCtx),
@@ -226,12 +226,11 @@ public:
return true;
}
- BSONObjComparator bsonCmp(
- BSONObj(),
- BSONObjComparator::FieldNamesMode::kConsider,
- !collation.isEmpty()
- ? collator.get()
- : (routingInfo.cm() ? routingInfo.cm()->getDefaultCollator() : nullptr));
+ BSONObjComparator bsonCmp(BSONObj(),
+ BSONObjComparator::FieldNamesMode::kConsider,
+ !collation.isEmpty()
+ ? collator.get()
+ : (cm.isSharded() ? cm.getDefaultCollator() : nullptr));
BSONObjSet all = bsonCmp.makeBSONObjSet();
for (const auto& response : shardResponses) {