diff options
author | Benety Goh <benety@mongodb.com> | 2018-12-20 23:34:46 -0500 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2018-12-20 23:35:03 -0500 |
commit | 4270e87c62a2c7ea365b20bb37ede7e3888ad0ed (patch) | |
tree | 2d5b891bb3934dfaa09e87d3294a7653e401b7d1 /src/mongo/db/s/shard_filtering_metadata_refresh.cpp | |
parent | 3c140cdd63bbf20e585bbbccd21ed3ea64e656b1 (diff) | |
download | mongo-4270e87c62a2c7ea365b20bb37ede7e3888ad0ed.tar.gz |
SERVER-38719 rename DatabaseHolder::get() to getDb()
Repurpose DatabaseHolder::get() for accessing singleton.
Deprecate DatabaseHolder::getDatabaseHolder().
Diffstat (limited to 'src/mongo/db/s/shard_filtering_metadata_refresh.cpp')
-rw-r--r-- | src/mongo/db/s/shard_filtering_metadata_refresh.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/db/s/shard_filtering_metadata_refresh.cpp b/src/mongo/db/s/shard_filtering_metadata_refresh.cpp index 81336bd386b..4fd28b98032 100644 --- a/src/mongo/db/s/shard_filtering_metadata_refresh.cpp +++ b/src/mongo/db/s/shard_filtering_metadata_refresh.cpp @@ -237,11 +237,12 @@ void forceDatabaseRefresh(OperationContext* opCtx, const StringData dbName) { // First, check under a shared lock if another thread already updated the cached version. // This is a best-effort optimization to make as few threads as possible to convoy on the // exclusive lock below. + auto databaseHolder = DatabaseHolder::get(opCtx); { // Take the DBLock directly rather than using AutoGetDb, to prevent a recursive call // into checkDbVersion(). Lock::DBLock dbLock(opCtx, dbName, MODE_IS); - const auto db = DatabaseHolder::getDatabaseHolder().get(opCtx, dbName); + auto db = databaseHolder->getDb(opCtx, dbName); if (!db) { log() << "Database " << dbName << " has been dropped; not caching the refreshed databaseVersion"; @@ -261,7 +262,7 @@ void forceDatabaseRefresh(OperationContext* opCtx, const StringData dbName) { // The cached version is older than the refreshed version; update the cached version. Lock::DBLock dbLock(opCtx, dbName, MODE_X); - const auto db = DatabaseHolder::getDatabaseHolder().get(opCtx, dbName); + auto db = databaseHolder->getDb(opCtx, dbName); if (!db) { log() << "Database " << dbName << " has been dropped; not caching the refreshed databaseVersion"; |