summaryrefslogtreecommitdiff
path: root/src/mongo/db/sessions_collection.cpp
diff options
context:
space:
mode:
authorKevin Pulo <kevin.pulo@mongodb.com>2020-02-20 21:42:07 +1100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-03-05 13:03:43 +0000
commit747ff353cbc819d032fa727d4bd7ffad16ea0437 (patch)
treed9b3d7e9af26138d7b74e0416a93d6110e326af0 /src/mongo/db/sessions_collection.cpp
parent7c4b875a8858c5bd5efc9bf4f285f7f440fdfdc0 (diff)
downloadmongo-747ff353cbc819d032fa727d4bd7ffad16ea0437.tar.gz
SERVER-45692 add explicit RWC to inter-node commands (even if merely kImplicitDefault)
Diffstat (limited to 'src/mongo/db/sessions_collection.cpp')
-rw-r--r--src/mongo/db/sessions_collection.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mongo/db/sessions_collection.cpp b/src/mongo/db/sessions_collection.cpp
index 4e0e121abaf..b883bebf76c 100644
--- a/src/mongo/db/sessions_collection.cpp
+++ b/src/mongo/db/sessions_collection.cpp
@@ -40,6 +40,7 @@
#include "mongo/db/create_indexes_gen.h"
#include "mongo/db/logical_session_id.h"
#include "mongo/db/ops/write_ops.h"
+#include "mongo/db/repl/read_concern_args.h"
#include "mongo/rpc/get_status_from_command_result.h"
#include "mongo/s/write_ops/batched_command_response.h"
@@ -234,7 +235,10 @@ LogicalSessionIdSet SessionsCollection::_doFindRemoved(
LogicalSessionIdSet removed{sessions.begin(), sessions.end()};
auto wrappedSend = [&](BSONObj batch) {
- auto swBatchResult = send(batch);
+ BSONObjBuilder batchWithReadConcernLocal(batch);
+ batchWithReadConcernLocal.append(repl::ReadConcernArgs::kReadConcernFieldName,
+ repl::ReadConcernArgs::kImplicitDefault);
+ auto swBatchResult = send(batchWithReadConcernLocal.obj());
auto result =
SessionsCollectionFetchResult::parse("SessionsCollectionFetchResult"_sd, swBatchResult);
@@ -279,7 +283,9 @@ BSONObj SessionsCollection::generateCreateIndexesCmd() {
createIndexes.setCreateIndexes(NamespaceString::kLogicalSessionsNamespace.coll());
createIndexes.setIndexes(std::move(indexes));
- return createIndexes.toBSON();
+ return BSONObjBuilder(createIndexes.toBSON())
+ .append(WriteConcernOptions::kWriteConcernField, WriteConcernOptions::kImplicitDefault)
+ .obj();
}
BSONObj SessionsCollection::generateCollModCmd() {
@@ -292,6 +298,8 @@ BSONObj SessionsCollection::generateCollModCmd() {
indexBuilder << "expireAfterSeconds" << localLogicalSessionTimeoutMinutes * 60;
indexBuilder.done();
+ collModCmdBuilder.append(WriteConcernOptions::kWriteConcernField,
+ WriteConcernOptions::kImplicitDefault);
collModCmdBuilder.done();
return collModCmdBuilder.obj();