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_sharded.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_sharded.h')
-rw-r--r-- | src/mongo/db/sessions_collection_sharded.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mongo/db/sessions_collection_sharded.h b/src/mongo/db/sessions_collection_sharded.h index bd377d369bd..95aba591cb7 100644 --- a/src/mongo/db/sessions_collection_sharded.h +++ b/src/mongo/db/sessions_collection_sharded.h @@ -73,6 +73,20 @@ public: protected: Status _checkCacheForSessionsCollection(OperationContext* opCtx); + + /** + * These two methods use the sharding routing metadata to do a best effort attempt at grouping + * the specified set of sessions by the shards, which have the records for these sessions. This + * is done as an attempt to avoid broadcast queries. + * + * The reason it is 'best effort' is because it makes no attempt at checking whether the routing + * table is up-to-date and just picks up whatever was most recently fetched from the config + * server, which could be stale. + */ + std::vector<LogicalSessionId> _groupSessionIdsByOwningShard( + OperationContext* opCtx, const LogicalSessionIdSet& sessions); + std::vector<LogicalSessionRecord> _groupSessionRecordsByOwningShard( + OperationContext* opCtx, const LogicalSessionRecordSet& sessions); }; } // namespace mongo |