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/balancer/balancer_chunk_selection_policy_impl.cpp | |
parent | 7d155b747d0e867a10644b69093cd1f9bc809bc2 (diff) | |
download | mongo-5c16643eadef9d516c1c5286a3c7cd28b52c03cb.tar.gz |
SERVER-59052 Remove deprecated ChunkType::ns field
Diffstat (limited to 'src/mongo/db/s/balancer/balancer_chunk_selection_policy_impl.cpp')
-rw-r--r-- | src/mongo/db/s/balancer/balancer_chunk_selection_policy_impl.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mongo/db/s/balancer/balancer_chunk_selection_policy_impl.cpp b/src/mongo/db/s/balancer/balancer_chunk_selection_policy_impl.cpp index 62d044a30ef..1c8d241778b 100644 --- a/src/mongo/db/s/balancer/balancer_chunk_selection_policy_impl.cpp +++ b/src/mongo/db/s/balancer/balancer_chunk_selection_policy_impl.cpp @@ -76,7 +76,7 @@ StatusWith<DistributionStatus> createCollectionDistributionStatus( chunkMgr.forEachChunk([&](const auto& chunkEntry) { ChunkType chunk; - chunk.setNS(nss); + chunk.setCollectionUUID(*chunkMgr.getUUID()); chunk.setMin(chunkEntry.getMin()); chunk.setMax(chunkEntry.getMax()); chunk.setJumbo(chunkEntry.isJumbo()); @@ -442,7 +442,10 @@ BalancerChunkSelectionPolicyImpl::selectSpecificChunkToMove(OperationContext* op const auto& shardStats = shardStatsStatus.getValue(); - const auto& nss = chunk.getNS(); + const CollectionType collection = Grid::get(opCtx)->catalogClient()->getCollection( + opCtx, chunk.getCollectionUUID(), repl::ReadConcernLevel::kLocalReadConcern); + + const auto& nss = collection.getNss(); auto routingInfoStatus = Grid::get(opCtx)->catalogCache()->getShardedCollectionRoutingInfoWithRefresh(opCtx, nss); @@ -470,7 +473,10 @@ Status BalancerChunkSelectionPolicyImpl::checkMoveAllowed(OperationContext* opCt return shardStatsStatus.getStatus(); } - const auto& nss = chunk.getNS(); + const CollectionType collection = Grid::get(opCtx)->catalogClient()->getCollection( + opCtx, chunk.getCollectionUUID(), repl::ReadConcernLevel::kLocalReadConcern); + const auto& nss = collection.getNss(); + auto shardStats = std::move(shardStatsStatus.getValue()); |