Skip to content

Commit 0144673

Browse files
krutishah139MongoDB Bot
authored and
MongoDB Bot
committed
SERVER-95452 Stops getting chunk ranges unnecessarily in _targetQuery (#27756) (#31562)
GitOrigin-RevId: 1624e181d0dac03edb34ef25b9b58a6d79969825
1 parent b44f11a commit 0144673

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/mongo/s/collection_routing_info_targeter.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -643,11 +643,13 @@ StatusWith<std::vector<ShardEndpoint>> CollectionRoutingInfoTargeter::_targetQue
643643
}
644644

645645
std::set<ShardId> shardIds;
646-
QueryTargetingInfo info;
647646
try {
648-
getShardIdsForQuery(expCtx, query, collation, _cri.cm, &shardIds, &info);
649647
if (chunkRanges) {
648+
QueryTargetingInfo info;
649+
getShardIdsForQuery(expCtx, query, collation, _cri.cm, &shardIds, &info);
650650
chunkRanges->swap(info.chunkRanges);
651+
} else {
652+
getShardIdsForQuery(expCtx, query, collation, _cri.cm, &shardIds);
651653
}
652654
} catch (const DBException& ex) {
653655
return ex.toStatus();

0 commit comments

Comments
 (0)