[SERVER-86097] Try not to call planShardedSearch on mongos if we will not need to merge results (unsharded or single shard) Created: 01/Feb/24  Updated: 02/Feb/24

Status: Needs Scheduling
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Charlie Swanson Assignee: Backlog - Query Integration
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-85694 $searchMeta aggregation pipeline stag... Closed
Assigned Teams:
Query Integration
Participants:

 Description   

InĀ SERVER-85694 we saw a bug here which was pretty hard to track down due to the unintuitive nature of how this works. In this ticket we suggest trying out:

  • Clear lifecycle phases for a sharded $search or $searchMeta. For example, it is parsed as $search and only in 'distributedPlanLogic' would it call 'planShardedSearch'. With that done, it would stop being a $search and become a $internalSearchMongotRemote plus the merging pipeline.
  • removing the special cases for 'pExpCtx->needsMerge' from $internalSearchMongotRemote and friends. It should be clear from the setup of the stages whether you need to merge or not.

Generated at Thu Feb 08 06:59:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.