summaryrefslogtreecommitdiff
path: root/src/mongo/s/chunk_manager.cpp
diff options
context:
space:
mode:
authorBlake Oler <blake.oler@mongodb.com>2020-08-27 19:26:02 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-09-02 06:32:58 +0000
commit52f77e8edb3e422d3329915933c0633a3c09786e (patch)
tree17940801db8e0eff039cd01c75e4a9aaf37fda3a /src/mongo/s/chunk_manager.cpp
parent6e40b75f137d4d4abebd5d0f3395bd96549ddc6d (diff)
downloadmongo-52f77e8edb3e422d3329915933c0633a3c09786e.tar.gz
SERVER-49568 Thread the CollectionType's ReshardingFields through to the CatalogCache refresh
Diffstat (limited to 'src/mongo/s/chunk_manager.cpp')
-rw-r--r--src/mongo/s/chunk_manager.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/mongo/s/chunk_manager.cpp b/src/mongo/s/chunk_manager.cpp
index a159b3f0ca0..bb1dd46caec 100644
--- a/src/mongo/s/chunk_manager.cpp
+++ b/src/mongo/s/chunk_manager.cpp
@@ -300,17 +300,20 @@ ChunkMap::_overlappingBounds(const BSONObj& min, const BSONObj& max, bool isMaxI
ShardVersionTargetingInfo::ShardVersionTargetingInfo(const OID& epoch)
: shardVersion(0, 0, epoch) {}
-RoutingTableHistory::RoutingTableHistory(NamespaceString nss,
- boost::optional<UUID> uuid,
- KeyPattern shardKeyPattern,
- std::unique_ptr<CollatorInterface> defaultCollator,
- bool unique,
- ChunkMap chunkMap)
+RoutingTableHistory::RoutingTableHistory(
+ NamespaceString nss,
+ boost::optional<UUID> uuid,
+ KeyPattern shardKeyPattern,
+ std::unique_ptr<CollatorInterface> defaultCollator,
+ bool unique,
+ boost::optional<TypeCollectionReshardingFields> reshardingFields,
+ ChunkMap chunkMap)
: _nss(std::move(nss)),
_uuid(uuid),
_shardKeyPattern(shardKeyPattern),
_defaultCollator(std::move(defaultCollator)),
_unique(unique),
+ _reshardingFields(std::move(reshardingFields)),
_chunkMap(std::move(chunkMap)),
_shardVersions(_chunkMap.constructShardVersionMap()) {}
@@ -707,17 +710,20 @@ std::shared_ptr<RoutingTableHistory> RoutingTableHistory::makeNew(
std::unique_ptr<CollatorInterface> defaultCollator,
bool unique,
OID epoch,
+ boost::optional<TypeCollectionReshardingFields> reshardingFields,
const std::vector<ChunkType>& chunks) {
return RoutingTableHistory(std::move(nss),
std::move(uuid),
std::move(shardKeyPattern),
std::move(defaultCollator),
std::move(unique),
+ boost::none,
ChunkMap{epoch})
- .makeUpdated(chunks);
+ .makeUpdated(std::move(reshardingFields), chunks);
}
std::shared_ptr<RoutingTableHistory> RoutingTableHistory::makeUpdated(
+ boost::optional<TypeCollectionReshardingFields> reshardingFields,
const std::vector<ChunkType>& changedChunks) {
// It's possible for there to be one chunk in changedChunks without the routing table having
@@ -746,6 +752,7 @@ std::shared_ptr<RoutingTableHistory> RoutingTableHistory::makeUpdated(
KeyPattern(getShardKeyPattern().getKeyPattern()),
CollatorInterface::cloneCollator(getDefaultCollator()),
isUnique(),
+ std::move(reshardingFields),
std::move(chunkMap)));
}