summaryrefslogtreecommitdiff
path: root/src/mongo/s/query/cluster_aggregation_planner.cpp
diff options
context:
space:
mode:
authorJennifer Peshansky <jennifer.peshansky@mongodb.com>2022-03-01 22:14:07 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-03-03 17:49:51 +0000
commit4f3626ff4486e672569699dfde1cc0ae8c54d348 (patch)
tree6f7c98048b3e6d31aa2594d7ef20adaabbed220b /src/mongo/s/query/cluster_aggregation_planner.cpp
parent212e9839ba0de9f85b1cebe9ae13f6b7a40aa85d (diff)
downloadmongo-4f3626ff4486e672569699dfde1cc0ae8c54d348.tar.gz
SERVER-63774 Pass optional dbVersion to runPipelineOnSpecificShard
Diffstat (limited to 'src/mongo/s/query/cluster_aggregation_planner.cpp')
-rw-r--r--src/mongo/s/query/cluster_aggregation_planner.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mongo/s/query/cluster_aggregation_planner.cpp b/src/mongo/s/query/cluster_aggregation_planner.cpp
index 9430ddb8270..a87ee78aa11 100644
--- a/src/mongo/s/query/cluster_aggregation_planner.cpp
+++ b/src/mongo/s/query/cluster_aggregation_planner.cpp
@@ -629,7 +629,7 @@ Status runPipelineOnPrimaryShard(const boost::intrusive_ptr<ExpressionContext>&
if (feature_flags::gFeatureFlagPerShardCursor.isEnabledAndIgnoreFCV()) {
return runPipelineOnSpecificShardOnly(expCtx,
namespaces,
- cm,
+ boost::optional<DatabaseVersion>(cm.dbVersion()),
explain,
serializedCommand,
privileges,
@@ -847,7 +847,7 @@ std::pair<BSONObj, boost::optional<UUID>> getCollationAndUUID(
Status runPipelineOnSpecificShardOnly(const boost::intrusive_ptr<ExpressionContext>& expCtx,
const ClusterAggregate::Namespaces& namespaces,
- const ChunkManager& cm,
+ boost::optional<DatabaseVersion> dbVersion,
boost::optional<ExplainOptions::Verbosity> explain,
Document serializedCommand,
const PrivilegeVector& privileges,
@@ -875,8 +875,9 @@ Status runPipelineOnSpecificShardOnly(const boost::intrusive_ptr<ExpressionConte
cmdObj = appendShardVersion(std::move(cmdObj), ChunkVersion::UNSHARDED());
}
if (!forPerShardCursor) {
- // Per shard cursors should not send any shard version info.
- cmdObj = appendDbVersionIfPresent(std::move(cmdObj), cm.dbVersion());
+ // Unless this is a per shard cursor, we need to send shard version info.
+ tassert(6377400, "Missing shard versioning information", dbVersion.has_value());
+ cmdObj = appendDbVersionIfPresent(std::move(cmdObj), *dbVersion);
}
MultiStatementTransactionRequestsSender ars(