summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Zolnierz <nicholas.zolnierz@mongodb.com>2018-06-08 16:02:32 -0400
committerBernard Gorman <bernard.gorman@gmail.com>2018-06-15 20:30:40 +0100
commit0a42e212a77bb187abc3c56795fda44abb49c3ea (patch)
tree0bc71175460448f1b1da4dc7b065aaae6d95a0a0
parentecd6d5c33eb562d5a4694699da581852c6d61d93 (diff)
downloadmongo-0a42e212a77bb187abc3c56795fda44abb49c3ea.tar.gz
SERVER-35255: whole-cluster $changeStreams send listCollections to the config server for the 'admin' and/or 'config' databases
(cherry picked from commit 2a60402197dbbfe65894beaa54936bd657e7bf20)
-rw-r--r--src/mongo/s/commands/cluster_aggregate.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/s/commands/cluster_aggregate.cpp b/src/mongo/s/commands/cluster_aggregate.cpp
index 6bc5cc2a9ef..e745feb72bc 100644
--- a/src/mongo/s/commands/cluster_aggregate.cpp
+++ b/src/mongo/s/commands/cluster_aggregate.cpp
@@ -619,6 +619,13 @@ BSONObj establishMergingMongosCursor(OperationContext* opCtx,
BSONObj getDefaultCollationForUnshardedCollection(const Shard* primaryShard,
const NamespaceString& nss) {
+ // Because collectionless aggregations are generally run against the 'admin' database, the
+ // standard logic will attempt to resolve its non-existent collation by sending a specious
+ // 'listCollections' command to the config servers. To prevent this, we immediately return an
+ // empty BSONObj if the namespace is collectionless.
+ if (nss.isCollectionlessAggregateNS()) {
+ return BSONObj();
+ }
ScopedDbConnection conn(primaryShard->getConnString());
BSONObj defaultCollation;
std::list<BSONObj> all =