diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2019-07-08 09:00:56 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2019-07-09 05:25:32 -0400 |
commit | d85ac8993cf7920eea9b7a9d4c1389474a507771 (patch) | |
tree | 04440b66eb54a32b75c3eb5ed898af01f9621e8a /src/mongo/s | |
parent | 0c1ada42cd3a0daf86739308339a1e2817ec1362 (diff) | |
download | mongo-d85ac8993cf7920eea9b7a9d4c1389474a507771.tar.gz |
SERVER-41867 Do not reacquire the catalog cache mutex if getDatabase/getChunksSince throws
(cherry picked from commit f7fc5eb7ffd428bfb02ec63abd04898c74d31043)
Diffstat (limited to 'src/mongo/s')
-rw-r--r-- | src/mongo/s/catalog_cache.cpp | 8 |
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 |