summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline
diff options
context:
space:
mode:
authorArun Banala <arun.banala@mongodb.com>2022-05-09 12:19:59 +0100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-05-09 14:53:39 +0000
commit486b3428d8b545e40bda7e0ad0b03007f255a011 (patch)
tree8773dd56be4090644e8ee7c9735e6f80b9ab0d8c /src/mongo/db/pipeline
parent5a4e56115f8ffa057c8e7fda5fb0980e85fdb28b (diff)
downloadmongo-486b3428d8b545e40bda7e0ad0b03007f255a011.tar.gz
SERVER-66307 [v6.0]Set $_generateV2ResumeTokens parameter only on mongos
Diffstat (limited to 'src/mongo/db/pipeline')
-rw-r--r--src/mongo/db/pipeline/sharded_agg_helpers.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/db/pipeline/sharded_agg_helpers.cpp b/src/mongo/db/pipeline/sharded_agg_helpers.cpp
index f63f6c61bc6..cf110d53f43 100644
--- a/src/mongo/db/pipeline/sharded_agg_helpers.cpp
+++ b/src/mongo/db/pipeline/sharded_agg_helpers.cpp
@@ -57,6 +57,7 @@
#include "mongo/rpc/get_status_from_command_result.h"
#include "mongo/s/cluster_commands_helpers.h"
#include "mongo/s/collection_uuid_mismatch.h"
+#include "mongo/s/is_mongos.h"
#include "mongo/s/query/cluster_query_knobs_gen.h"
#include "mongo/s/query/document_source_merge_cursors.h"
#include "mongo/s/query/establish_cursors.h"
@@ -115,7 +116,7 @@ RemoteCursor openChangeStreamNewShardMonitor(const boost::intrusive_ptr<Expressi
aggReq.setNeedsMerge(true);
// TODO SERVER-65370: from 6.1 onwards, we will default to v2 and this block should be removed.
- if (expCtx->inMongos) {
+ if (isMongos()) {
aggReq.setGenerateV2ResumeTokens(expCtx->changeStreamTokenVersion == 2);
}
@@ -158,7 +159,7 @@ BSONObj genericTransformForShards(MutableDocument&& cmdForShards,
// that a 6.0 mongoS on a mixed 6.0/7.0 cluster will see only v1 tokens in the stream.
// TODO SERVER-65370: from 6.1 onwards, we will default to v2 and this block should be removed.
const auto& v2FieldName = AggregateCommandRequest::kGenerateV2ResumeTokensFieldName;
- if (auto cmdObj = cmdForShards.peek(); expCtx->inMongos && cmdObj[v2FieldName].missing()) {
+ if (auto cmdObj = cmdForShards.peek(); isMongos() && cmdObj[v2FieldName].missing()) {
cmdForShards[v2FieldName] = Value(false);
}