diff options
author | Nick Zolnierz <nicholas.zolnierz@mongodb.com> | 2018-06-08 16:02:32 -0400 |
---|---|---|
committer | Bernard Gorman <bernard.gorman@gmail.com> | 2018-06-15 20:30:40 +0100 |
commit | 0a42e212a77bb187abc3c56795fda44abb49c3ea (patch) | |
tree | 0bc71175460448f1b1da4dc7b065aaae6d95a0a0 | |
parent | ecd6d5c33eb562d5a4694699da581852c6d61d93 (diff) | |
download | mongo-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.cpp | 7 |
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 = |