From 9bcb318c4c9f2c482413a9d85b7e7c99c0492653 Mon Sep 17 00:00:00 2001 From: Charlie Swanson Date: Mon, 20 May 2019 17:39:25 -0400 Subject: SERVER-23923 Track writeConcern through getMores --- src/mongo/db/clientcursor.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/mongo/db/clientcursor.h') diff --git a/src/mongo/db/clientcursor.h b/src/mongo/db/clientcursor.h index 92f51255ed5..4694031ccc1 100644 --- a/src/mongo/db/clientcursor.h +++ b/src/mongo/db/clientcursor.h @@ -78,13 +78,15 @@ struct ClientCursorParams { ClientCursorParams(std::unique_ptr planExecutor, NamespaceString nss, UserNameIterator authenticatedUsersIter, + WriteConcernOptions writeConcernOptions, repl::ReadConcernArgs readConcernArgs, BSONObj originatingCommandObj, LockPolicy lockPolicy, PrivilegeVector originatingPrivileges) : exec(std::move(planExecutor)), nss(std::move(nss)), - readConcernArgs(readConcernArgs), + writeConcernOptions(std::move(writeConcernOptions)), + readConcernArgs(std::move(readConcernArgs)), queryOptions(exec->getCanonicalQuery() ? exec->getCanonicalQuery()->getQueryRequest().getOptions() : 0), @@ -113,6 +115,7 @@ struct ClientCursorParams { std::unique_ptr exec; const NamespaceString nss; std::vector authenticatedUsers; + const WriteConcernOptions writeConcernOptions; const repl::ReadConcernArgs readConcernArgs; int queryOptions = 0; BSONObj originatingCommandObj; @@ -165,6 +168,10 @@ public: return _readConcernArgs; } + WriteConcernOptions getWriteConcernOptions() const { + return _writeConcernOptions; + } + /** * Returns a pointer to the underlying query plan executor. All cursors manage a PlanExecutor, * so this method never returns a null pointer. @@ -370,6 +377,7 @@ private: // A transaction number for this cursor, if it was provided in the originating command. const boost::optional _txnNumber; + const WriteConcernOptions _writeConcernOptions; const repl::ReadConcernArgs _readConcernArgs; // Tracks whether dispose() has been called, to make sure it happens before destruction. It is -- cgit v1.2.1