diff options
author | Simon Graetzer <simon.gratzer@mongodb.com> | 2021-08-29 18:47:27 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-08-29 19:25:04 +0000 |
commit | 5c16643eadef9d516c1c5286a3c7cd28b52c03cb (patch) | |
tree | 6dcf16f2b9a6131769135fa2d70dfc5eb9e31ccb /src/mongo/db/s/config/sharding_catalog_manager_collection_operations.cpp | |
parent | 7d155b747d0e867a10644b69093cd1f9bc809bc2 (diff) | |
download | mongo-5c16643eadef9d516c1c5286a3c7cd28b52c03cb.tar.gz |
SERVER-59052 Remove deprecated ChunkType::ns field
Diffstat (limited to 'src/mongo/db/s/config/sharding_catalog_manager_collection_operations.cpp')
-rw-r--r-- | src/mongo/db/s/config/sharding_catalog_manager_collection_operations.cpp | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/src/mongo/db/s/config/sharding_catalog_manager_collection_operations.cpp b/src/mongo/db/s/config/sharding_catalog_manager_collection_operations.cpp index 84d951d1cd2..591917bfad4 100644 --- a/src/mongo/db/s/config/sharding_catalog_manager_collection_operations.cpp +++ b/src/mongo/db/s/config/sharding_catalog_manager_collection_operations.cpp @@ -134,21 +134,14 @@ boost::optional<UUID> checkCollectionOptions(OperationContext* opCtx, } void triggerFireAndForgetShardRefreshes(OperationContext* opCtx, const CollectionType& coll) { + invariant(coll.getTimestamp()); const auto shardRegistry = Grid::get(opCtx)->shardRegistry(); const auto allShards = uassertStatusOK(Grid::get(opCtx)->catalogClient()->getAllShards( opCtx, repl::ReadConcernLevel::kLocalReadConcern)) .value; - for (const auto& shardEntry : allShards) { - const auto query = [&]() { - if (coll.getTimestamp()) { - return BSON(ChunkType::collectionUUID << coll.getUuid() - << ChunkType::shard(shardEntry.getName())); - } else { - return BSON(ChunkType::ns(coll.getNss().ns()) - << ChunkType::shard(shardEntry.getName())); - } - }(); + const auto query = BSON(ChunkType::collectionUUID + << coll.getUuid() << ChunkType::shard(shardEntry.getName())); const auto chunk = uassertStatusOK(shardRegistry->getConfigShard()->exhaustiveFindOnConfig( opCtx, @@ -359,13 +352,7 @@ void ShardingCatalogManager::refineCollectionShardKey(OperationContext* opCtx, // to the newly-generated objectid, (ii) their bounds for each new field in the refined // key to MinKey (except for the global max chunk where the max bounds are set to // MaxKey), and unsetting (iii) their jumbo field. - const auto chunksQuery = [&]() { - if (collType.getTimestamp()) { - return BSON(ChunkType::collectionUUID << collType.getUuid()); - } else { - return BSON(ChunkType::ns(collType.getNss().ns())); - } - }(); + const auto chunksQuery = BSON(ChunkType::collectionUUID << collType.getUuid()); writeToConfigDocumentInTxn( opCtx, ChunkType::ConfigNS, |