summaryrefslogtreecommitdiff
path: root/src/mongo/executor/remote_command_request.cpp
diff options
context:
space:
mode:
authorA. Jesse Jiryu Davis <jesse@mongodb.com>2020-08-22 10:17:48 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-09-10 00:34:29 +0000
commit74c76f296cfe3e6c2943d248bec49c84c0ea5b96 (patch)
treea18a1f707c65a8b20c31a0882e7f72be64d17655 /src/mongo/executor/remote_command_request.cpp
parent2b5dc35f019a3606c2dfa845cdfb320ffbac8014 (diff)
downloadmongo-74c76f296cfe3e6c2943d248bec49c84c0ea5b96.tar.gz
SERVER-50375 Ensure mongos forwards API params to shards
Diffstat (limited to 'src/mongo/executor/remote_command_request.cpp')
-rw-r--r--src/mongo/executor/remote_command_request.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/executor/remote_command_request.cpp b/src/mongo/executor/remote_command_request.cpp
index 875da25ef9f..4c35525e6a9 100644
--- a/src/mongo/executor/remote_command_request.cpp
+++ b/src/mongo/executor/remote_command_request.cpp
@@ -34,6 +34,7 @@
#include <fmt/format.h>
#include "mongo/bson/simple_bsonobj_comparator.h"
+#include "mongo/db/api_parameters.h"
#include "mongo/db/operation_context.h"
#include "mongo/db/query/query_request.h"
#include "mongo/platform/atomic_word.h"
@@ -86,6 +87,12 @@ RemoteCommandRequestBase::RemoteCommandRequestBase(RequestId requestId,
cmdObj = cmdObj.addField(BSON("clientOperationKey" << operationKey.get()).firstElement());
}
+ if (opCtx && APIParameters::get(opCtx).getParamsPassed()) {
+ BSONObjBuilder bob(std::move(cmdObj));
+ APIParameters::get(opCtx).appendInfo(&bob);
+ cmdObj = bob.obj();
+ }
+
_updateTimeoutFromOpCtxDeadline(opCtx);
}