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.h | |
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.h')
-rw-r--r-- | src/mongo/db/sessions_collection.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/mongo/db/sessions_collection.h b/src/mongo/db/sessions_collection.h index b8bdfe83ed2..64e78c8a476 100644 --- a/src/mongo/db/sessions_collection.h +++ b/src/mongo/db/sessions_collection.h @@ -102,31 +102,34 @@ protected: * Makes a send function for the given client. */ using SendBatchFn = stdx::function<Status(BSONObj batch)>; - SendBatchFn makeSendFnForCommand(const NamespaceString& ns, DBClientBase* client); - SendBatchFn makeSendFnForBatchWrite(const NamespaceString& ns, DBClientBase* client); + static SendBatchFn makeSendFnForCommand(const NamespaceString& ns, DBClientBase* client); + static SendBatchFn makeSendFnForBatchWrite(const NamespaceString& ns, DBClientBase* client); + using FindBatchFn = stdx::function<StatusWith<BSONObj>(BSONObj batch)>; - FindBatchFn makeFindFnForCommand(const NamespaceString& ns, DBClientBase* client); + static FindBatchFn makeFindFnForCommand(const NamespaceString& ns, DBClientBase* client); /** * Formats and sends batches of refreshes for the given set of sessions. */ Status doRefresh(const NamespaceString& ns, - const LogicalSessionRecordSet& sessions, + const std::vector<LogicalSessionRecord>& sessions, SendBatchFn send); /** * Formats and sends batches of deletes for the given set of sessions. */ Status doRemove(const NamespaceString& ns, - const LogicalSessionIdSet& sessions, + const std::vector<LogicalSessionId>& sessions, SendBatchFn send); /** - * Formats and sends batches of fetches for the given set of sessions. + * Returns those lsids from the input 'sessions' array which are not present in the sessions + * collection (essentially performs an inner join of 'sessions' against the sessions + * collection). */ - StatusWith<LogicalSessionIdSet> doFetch(const NamespaceString& ns, - const LogicalSessionIdSet& sessions, - FindBatchFn send); + StatusWith<LogicalSessionIdSet> doFindRemoved(const NamespaceString& ns, + const std::vector<LogicalSessionId>& sessions, + FindBatchFn send); }; } // namespace mongo |