diff options
Diffstat (limited to 'src/mongo/db/s/shard_server_catalog_cache_loader.cpp')
-rw-r--r-- | src/mongo/db/s/shard_server_catalog_cache_loader.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/mongo/db/s/shard_server_catalog_cache_loader.cpp b/src/mongo/db/s/shard_server_catalog_cache_loader.cpp index 385ab96afc8..77704557cb9 100644 --- a/src/mongo/db/s/shard_server_catalog_cache_loader.cpp +++ b/src/mongo/db/s/shard_server_catalog_cache_loader.cpp @@ -94,20 +94,14 @@ Status persistCollectionAndChangedChunks(OperationContext* opCtx, const CollectionAndChangedChunks& collAndChunks, const ChunkVersion& maxLoaderVersion) { // Update the collections collection entry for 'nss' in case there are any new updates. - ShardCollectionType update = ShardCollectionType(nss, - collAndChunks.epoch, - *collAndChunks.uuid, - collAndChunks.shardKeyPattern, - collAndChunks.shardKeyIsUnique); - - update.setUuid(*collAndChunks.uuid); - if (!collAndChunks.defaultCollation.isEmpty()) { - update.setDefaultCollation(collAndChunks.defaultCollation.getOwned()); - } - - if (collAndChunks.reshardingFields) { - update.setReshardingFields(collAndChunks.reshardingFields.get()); - } + ShardCollectionType update(nss, + collAndChunks.epoch, + *collAndChunks.uuid, + collAndChunks.shardKeyPattern, + collAndChunks.shardKeyIsUnique); + update.setDefaultCollation(collAndChunks.defaultCollation); + update.setReshardingFields(collAndChunks.reshardingFields); + update.setAllowMigrations(collAndChunks.allowMigrations); // Mark the chunk metadata as refreshing, so that secondaries are aware of refresh. update.setRefreshing(true); @@ -242,6 +236,7 @@ CollectionAndChangedChunks getPersistedMetadataSinceVersion(OperationContext* op shardCollectionEntry.getDefaultCollation(), shardCollectionEntry.getUnique(), shardCollectionEntry.getReshardingFields(), + shardCollectionEntry.getAllowMigrations(), std::move(changedChunks)}; } |