summaryrefslogtreecommitdiff
path: root/src/mongo/s/query/cluster_aggregation_planner.cpp
diff options
context:
space:
mode:
authorMickey. J Winters <mickey.winters@mongodb.com>2022-03-03 21:57:33 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-03-03 22:28:56 +0000
commitef2a62dcc27461d2be1b619c75bc04effa1f2021 (patch)
tree3f502ae6d6f8da7b79d16ced54157492c39700ca /src/mongo/s/query/cluster_aggregation_planner.cpp
parenta90eac974885febfc2499ca4c431e1d0ac20270e (diff)
downloadmongo-ef2a62dcc27461d2be1b619c75bc04effa1f2021.tar.gz
SERVER-63781 set per shard cursor initial batch size to 0
Diffstat (limited to 'src/mongo/s/query/cluster_aggregation_planner.cpp')
-rw-r--r--src/mongo/s/query/cluster_aggregation_planner.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mongo/s/query/cluster_aggregation_planner.cpp b/src/mongo/s/query/cluster_aggregation_planner.cpp
index a87ee78aa11..211715b0e1c 100644
--- a/src/mongo/s/query/cluster_aggregation_planner.cpp
+++ b/src/mongo/s/query/cluster_aggregation_planner.cpp
@@ -648,6 +648,7 @@ Status runPipelineOnPrimaryShard(const boost::intrusive_ptr<ExpressionContext>&
explain,
nullptr, /* pipeline */
BSONObj(),
+ boost::none,
boost::none);
const auto shardId = cm.dbPrimary();
@@ -856,10 +857,14 @@ Status runPipelineOnSpecificShardOnly(const boost::intrusive_ptr<ExpressionConte
BSONObjBuilder* out) {
auto opCtx = expCtx->opCtx;
+ boost::optional<int> overrideBatchSize;
if (forPerShardCursor) {
tassert(6273804,
"Per shard cursors are supposed to pass fromMongos: false to shards",
!expCtx->inMongos);
+ // By using an initial batchSize of zero all of the events will get returned through
+ // the getMore path and have metadata stripped out.
+ overrideBatchSize = 0;
}
// Format the command for the shard. This wraps the command as an explain if necessary, and
@@ -869,7 +874,8 @@ Status runPipelineOnSpecificShardOnly(const boost::intrusive_ptr<ExpressionConte
explain,
nullptr, /* pipeline */
BSONObj(),
- boost::none);
+ boost::none,
+ overrideBatchSize);
if (!forPerShardCursor && shardId != ShardId::kConfigServerId) {
cmdObj = appendShardVersion(std::move(cmdObj), ChunkVersion::UNSHARDED());