diff options
author | Blake Oler <blake.oler@mongodb.com> | 2020-02-06 00:54:43 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2020-02-06 00:54:43 +0000 |
commit | 552dd0f1ac0c9bf820de5b56a058fbe212221746 (patch) | |
tree | 92c48d8823c361219d12a6ffa0c35d90b60d4dac | |
parent | bb5f249a0d1a69c2e42cda5c255b705a24d58ff9 (diff) | |
download | mongo-552dd0f1ac0c9bf820de5b56a058fbe212221746.tar.gz |
SERVER-45980 Restrict scope of full loads to current operation in VersionManager::checkShardVersion()
-rw-r--r-- | src/mongo/s/client/version_manager.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mongo/s/client/version_manager.cpp b/src/mongo/s/client/version_manager.cpp index 8ad759b2b48..69a4ab67b5a 100644 --- a/src/mongo/s/client/version_manager.cpp +++ b/src/mongo/s/client/version_manager.cpp @@ -266,11 +266,10 @@ bool checkShardVersion(OperationContext* opCtx, auto const catalogCache = Grid::get(opCtx)->catalogCache(); - if (authoritative) { - Grid::get(opCtx)->catalogCache()->onEpochChange(nss); - } + auto routingInfoStatus = authoritative + ? catalogCache->getCollectionRoutingInfoWithRefresh(opCtx, nss) + : catalogCache->getCollectionRoutingInfo(opCtx, nss); - auto routingInfoStatus = catalogCache->getCollectionRoutingInfo(opCtx, nss); if (!routingInfoStatus.isOK()) { return false; } @@ -380,7 +379,7 @@ bool checkShardVersion(OperationContext* opCtx, return true; } - Grid::get(opCtx)->catalogCache()->onEpochChange(nss); + (void)catalogCache->getCollectionRoutingInfoWithRefresh(opCtx, nss); const int maxNumTries = 7; if (tryNumber < maxNumTries) { |