summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2019-07-08 09:00:56 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2019-07-09 05:06:00 -0400
commitf7fc5eb7ffd428bfb02ec63abd04898c74d31043 (patch)
tree4923128b2280814264e4f2f19e02560f511d6279
parentdffab828e9acefe36364ae9db85dbbd0979699e6 (diff)
downloadmongo-f7fc5eb7ffd428bfb02ec63abd04898c74d31043.tar.gz
SERVER-41867 Do not reacquire the catalog cache mutex if getDatabase/getChunksSince throws
-rw-r--r--src/mongo/s/catalog_cache.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mongo/s/catalog_cache.cpp b/src/mongo/s/catalog_cache.cpp
index 2615221e49d..e4a151f9ccc 100644
--- a/src/mongo/s/catalog_cache.cpp
+++ b/src/mongo/s/catalog_cache.cpp
@@ -464,7 +464,7 @@ void CatalogCache::report(BSONObjBuilder* builder) const {
_stats.report(&cacheStatsBuilder);
}
-void CatalogCache::_scheduleDatabaseRefresh(WithLock,
+void CatalogCache::_scheduleDatabaseRefresh(WithLock lk,
const std::string& dbName,
std::shared_ptr<DatabaseInfoEntry> dbEntry) {
const auto onRefreshCompleted =
@@ -533,8 +533,7 @@ void CatalogCache::_scheduleDatabaseRefresh(WithLock,
} catch (const DBException& ex) {
const auto status = ex.toStatus();
- stdx::lock_guard<stdx::mutex> lg(_mutex);
- onRefreshFailed(lg, status);
+ onRefreshFailed(lk, status);
}
}
@@ -658,8 +657,7 @@ void CatalogCache::_scheduleCollectionRefresh(WithLock lk,
// attempt.
invariant(status != ErrorCodes::ConflictingOperationInProgress);
- stdx::lock_guard<stdx::mutex> lg(_mutex);
- onRefreshFailed(lg, status);
+ onRefreshFailed(lk, status);
}
// The routing info for this collection shouldn't change, as other threads may try to use the