summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline
diff options
context:
space:
mode:
authorGregory Noma <gregory.noma@gmail.com>2020-03-06 13:44:21 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-03-06 18:55:43 +0000
commit08166f23783bd0d7fe0be847e149ccc977872378 (patch)
treee099b9fe47fb85b4744e42a4a3962ea586451afc /src/mongo/db/pipeline
parent9abdb8435b9a8c9acea81b8ef4f3fa7334717320 (diff)
downloadmongo-08166f23783bd0d7fe0be847e149ccc977872378.tar.gz
SERVER-45969 Test behavior of killOp and maxTimeMS with $out/$merge on secondaries
Diffstat (limited to 'src/mongo/db/pipeline')
-rw-r--r--src/mongo/db/pipeline/process_interface/replica_set_node_process_interface.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/process_interface/replica_set_node_process_interface.cpp b/src/mongo/db/pipeline/process_interface/replica_set_node_process_interface.cpp
index 70720b4442b..9fa7e95e3c3 100644
--- a/src/mongo/db/pipeline/process_interface/replica_set_node_process_interface.cpp
+++ b/src/mongo/db/pipeline/process_interface/replica_set_node_process_interface.cpp
@@ -211,6 +211,12 @@ StatusWith<BSONObj> ReplicaSetNodeProcessInterface::_executeCommandOnPrimary(
void ReplicaSetNodeProcessInterface::_attachGenericCommandArgs(OperationContext* opCtx,
BSONObjBuilder* cmd) const {
cmd->append(WriteConcernOptions::kWriteConcernField, opCtx->getWriteConcern().toBSON());
+
+ auto maxTimeMS = opCtx->getRemainingMaxTimeMillis();
+ if (maxTimeMS != Milliseconds::max()) {
+ cmd->append(QueryRequest::cmdOptionMaxTimeMS, durationCount<Milliseconds>(maxTimeMS));
+ }
+
logical_session_id_helpers::serializeLsidAndTxnNumber(opCtx, cmd);
}