diff options
author | Esha Maharishi <esha.maharishi@mongodb.com> | 2018-04-13 08:52:44 -0400 |
---|---|---|
committer | Esha Maharishi <esha.maharishi@mongodb.com> | 2018-04-13 15:08:34 -0400 |
commit | 3a8494c12ecaf85f4456ba7da54b5623e60dacbf (patch) | |
tree | e340429a2f457e02d76ebe6cf624fd08bb7e92ee /src/mongo/s/catalog_cache.h | |
parent | 8cca1f4c2b19c5f430ed3cb330fd2ef7a925b12f (diff) | |
download | mongo-3a8494c12ecaf85f4456ba7da54b5623e60dacbf.tar.gz |
SERVER-34163 Make refreshing a database entry in the CatalogCache asynchronous
Diffstat (limited to 'src/mongo/s/catalog_cache.h')
-rw-r--r-- | src/mongo/s/catalog_cache.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mongo/s/catalog_cache.h b/src/mongo/s/catalog_cache.h index 9903f19b3ec..35fecda1081 100644 --- a/src/mongo/s/catalog_cache.h +++ b/src/mongo/s/catalog_cache.h @@ -198,11 +198,28 @@ private: // unset if the cache entry has never been loaded, or should not be relied on). bool needsRefresh{true}; + // Contains a notification to be waited on for the refresh to complete (only available if + // needsRefresh is true) + std::shared_ptr<Notification<Status>> refreshCompletionNotification; + + // Until SERVER-34061 goes in, after a database refresh, one thread should also load the + // sharded collections. In case multiple threads were queued up on the refresh, this bool + // ensures only the first loads the collections. + bool mustLoadShardedCollections{true}; + // Contains the cached info about the database (only available if needsRefresh is false) boost::optional<DatabaseType> dbt; }; /** + * Non-blocking call which schedules an asynchronous refresh for the specified database. The + * database entry must be in the 'needsRefresh' state. + */ + void _scheduleDatabaseRefresh(WithLock, + const StringData dbName, + std::shared_ptr<DatabaseInfoEntry> dbEntry); + + /** * Non-blocking call which schedules an asynchronous refresh for the specified namespace. The * namespace must be in the 'needRefresh' state. */ |