diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2019-05-03 16:21:24 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2019-05-09 07:40:56 -0400 |
commit | 2791817876636c0cfd60d867f31c7a83cf3f18c1 (patch) | |
tree | 3aefcb1999cccf4cb53b2401a44857549ba8722a /src/mongo/db/sessions_collection.cpp | |
parent | 1b8a9f5dc5c3314042b55e7415a2a25045b32a94 (diff) | |
download | mongo-2791817876636c0cfd60d867f31c7a83cf3f18c1.tar.gz |
SERVER-37837 Get rid of TransactionReaper (Part 1)
This change gets rid of the TransactionReaper's usage of the
ReplicationCoordinator for checking whether it is primary or not and
makes the LogicalSessionCache joinable on shutdown.
It also removes the TransactionReaper's grouping per-shard optimization
and moves it all under SessionCollectionSharded.
Diffstat (limited to 'src/mongo/db/sessions_collection.cpp')
-rw-r--r-- | src/mongo/db/sessions_collection.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mongo/db/sessions_collection.cpp b/src/mongo/db/sessions_collection.cpp index fda30fb70f3..7ffc762201e 100644 --- a/src/mongo/db/sessions_collection.cpp +++ b/src/mongo/db/sessions_collection.cpp @@ -212,7 +212,7 @@ SessionsCollection::FindBatchFn SessionsCollection::makeFindFnForCommand(const N } Status SessionsCollection::doRefresh(const NamespaceString& ns, - const LogicalSessionRecordSet& sessions, + const std::vector<LogicalSessionRecord>& sessions, SendBatchFn send) { auto init = [ns](BSONObjBuilder* batch) { batch->append("update", ns.coll()); @@ -230,7 +230,7 @@ Status SessionsCollection::doRefresh(const NamespaceString& ns, } Status SessionsCollection::doRemove(const NamespaceString& ns, - const LogicalSessionIdSet& sessions, + const std::vector<LogicalSessionId>& sessions, SendBatchFn send) { auto init = [ns](BSONObjBuilder* batch) { batch->append("delete", ns.coll()); @@ -245,16 +245,15 @@ Status SessionsCollection::doRemove(const NamespaceString& ns, return runBulkCmd("deletes", init, add, send, sessions); } -StatusWith<LogicalSessionIdSet> SessionsCollection::doFetch(const NamespaceString& ns, - const LogicalSessionIdSet& sessions, - FindBatchFn send) { +StatusWith<LogicalSessionIdSet> SessionsCollection::doFindRemoved( + const NamespaceString& ns, const std::vector<LogicalSessionId>& sessions, FindBatchFn send) { auto makeT = [] { return std::vector<LogicalSessionId>{}; }; auto add = [](std::vector<LogicalSessionId>& batch, const LogicalSessionId& record) { batch.push_back(record); }; - LogicalSessionIdSet removed = sessions; + LogicalSessionIdSet removed{sessions.begin(), sessions.end()}; auto wrappedSend = [&](BSONObj batch) { auto swBatchResult = send(batch); |