diff options
author | Jack Mulrow <jack.mulrow@mongodb.com> | 2021-02-03 01:35:47 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-02-22 18:19:33 +0000 |
commit | 2b2e7980f099068f47fc7a651a6edd99c6e1abb3 (patch) | |
tree | c5b28b0423c0fddf94895f8d41338a99cca4a7a3 /src/mongo/db/keys_collection_manager.h | |
parent | afdff71322d2d714fa6c8a9e1a0038e04e0772a9 (diff) | |
download | mongo-2b2e7980f099068f47fc7a651a6edd99c6e1abb3.tar.gz |
SERVER-54205 Proactively load external keys into the keys cache
Diffstat (limited to 'src/mongo/db/keys_collection_manager.h')
-rw-r--r-- | src/mongo/db/keys_collection_manager.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mongo/db/keys_collection_manager.h b/src/mongo/db/keys_collection_manager.h index 73caf91fff9..50bfe04abfe 100644 --- a/src/mongo/db/keys_collection_manager.h +++ b/src/mongo/db/keys_collection_manager.h @@ -124,6 +124,11 @@ public: */ void clearCache(); + /** + * Loads the given external key into the keys collection cache. + */ + void cacheExternalKey(ExternalKeysCollectionDocument key); + private: /** * This is responsible for periodically performing refresh in the background. @@ -174,6 +179,11 @@ private: */ bool hasSeenKeys() const noexcept; + /** + * Returns if the periodic runner has entered shutdown. + */ + bool isInShutdown() const; + private: void _doPeriodicRefresh(ServiceContext* service, std::string threadName, @@ -182,7 +192,7 @@ private: AtomicWord<bool> _hasSeenKeys{false}; // protects all the member variables below. - Mutex _mutex = MONGO_MAKE_LATCH("PeriodicRunner::_mutex"); + mutable Mutex _mutex = MONGO_MAKE_LATCH("PeriodicRunner::_mutex"); std::shared_ptr<Notification<void>> _refreshRequest; stdx::condition_variable _refreshNeededCV; |