summaryrefslogtreecommitdiff
path: root/src/mongo/db/keys_collection_manager.h
diff options
context:
space:
mode:
authorJack Mulrow <jack.mulrow@mongodb.com>2021-02-03 01:35:47 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-02-22 18:19:33 +0000
commit2b2e7980f099068f47fc7a651a6edd99c6e1abb3 (patch)
treec5b28b0423c0fddf94895f8d41338a99cca4a7a3 /src/mongo/db/keys_collection_manager.h
parentafdff71322d2d714fa6c8a9e1a0038e04e0772a9 (diff)
downloadmongo-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.h12
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;