diff options
Diffstat (limited to 'src/mongo/s/catalog_cache.cpp')
-rw-r--r-- | src/mongo/s/catalog_cache.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/s/catalog_cache.cpp b/src/mongo/s/catalog_cache.cpp index a3d87fc598c..52a83f2c371 100644 --- a/src/mongo/s/catalog_cache.cpp +++ b/src/mongo/s/catalog_cache.cpp @@ -106,10 +106,15 @@ std::shared_ptr<RoutingTableHistory> refreshCollectionRoutingInfo( // Otherwise, we're making a whole new routing table. if (existingRoutingInfo && existingRoutingInfo->getVersion().epoch() == collectionAndChunks.epoch) { + if (collectionAndChunks.changedChunks.size() == 1 && + collectionAndChunks.changedChunks[0].getVersion() == + existingRoutingInfo->getVersion()) + return existingRoutingInfo; return existingRoutingInfo->makeUpdated(std::move(collectionAndChunks.reshardingFields), collectionAndChunks.changedChunks); } + auto defaultCollator = [&]() -> std::unique_ptr<CollatorInterface> { if (!collectionAndChunks.defaultCollation.isEmpty()) { // The collation should have been validated upon collection creation @@ -118,6 +123,7 @@ std::shared_ptr<RoutingTableHistory> refreshCollectionRoutingInfo( } return nullptr; }(); + return RoutingTableHistory::makeNew(nss, collectionAndChunks.uuid, KeyPattern(collectionAndChunks.shardKeyPattern), |