diff options
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()); |