summaryrefslogtreecommitdiff
path: root/src/mongo/s/catalog_cache.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2020-09-03 04:51:07 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-09-03 16:37:23 +0000
commit3df9c61b7747058cd84edd7a875b1524db57dd1d (patch)
tree64f914b41ba79c59022eed074ffaa7ddbf6741b5 /src/mongo/s/catalog_cache.cpp
parent58bc5d187eb30270353f68eef3977c5be57e4eb8 (diff)
downloadmongo-3df9c61b7747058cd84edd7a875b1524db57dd1d.tar.gz
SERVER-46199 Make the RoutingTableHistory movable
Diffstat (limited to 'src/mongo/s/catalog_cache.cpp')
-rw-r--r--src/mongo/s/catalog_cache.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/mongo/s/catalog_cache.cpp b/src/mongo/s/catalog_cache.cpp
index 52a83f2c371..19846e62b48 100644
--- a/src/mongo/s/catalog_cache.cpp
+++ b/src/mongo/s/catalog_cache.cpp
@@ -111,8 +111,9 @@ std::shared_ptr<RoutingTableHistory> refreshCollectionRoutingInfo(
existingRoutingInfo->getVersion())
return existingRoutingInfo;
- return existingRoutingInfo->makeUpdated(std::move(collectionAndChunks.reshardingFields),
- collectionAndChunks.changedChunks);
+ return std::make_shared<RoutingTableHistory>(
+ existingRoutingInfo->makeUpdated(std::move(collectionAndChunks.reshardingFields),
+ collectionAndChunks.changedChunks));
}
auto defaultCollator = [&]() -> std::unique_ptr<CollatorInterface> {
@@ -124,14 +125,15 @@ std::shared_ptr<RoutingTableHistory> refreshCollectionRoutingInfo(
return nullptr;
}();
- return RoutingTableHistory::makeNew(nss,
- collectionAndChunks.uuid,
- KeyPattern(collectionAndChunks.shardKeyPattern),
- std::move(defaultCollator),
- collectionAndChunks.shardKeyIsUnique,
- collectionAndChunks.epoch,
- std::move(collectionAndChunks.reshardingFields),
- collectionAndChunks.changedChunks);
+ return std::make_shared<RoutingTableHistory>(
+ RoutingTableHistory::makeNew(nss,
+ collectionAndChunks.uuid,
+ KeyPattern(collectionAndChunks.shardKeyPattern),
+ std::move(defaultCollator),
+ collectionAndChunks.shardKeyIsUnique,
+ collectionAndChunks.epoch,
+ std::move(collectionAndChunks.reshardingFields),
+ collectionAndChunks.changedChunks));
}();
std::set<ShardId> shardIds;