[SERVER-75010] Implement no-op planShardedSearch in 5.0 Created: 17/Mar/23  Updated: 29/Oct/23  Resolved: 21/Apr/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.4.22, 5.0.18

Type: Bug Priority: Major - P3
Reporter: Ben Shteinfeld Assignee: Ben Shteinfeld
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
depends on SERVER-75404 Designate $searchSortValues as metada... Closed
Documented
is documented by DOCS-16060 [Atlas Search] changes in SERVER-7501... Closed
Problem/Incident
causes SERVER-80499 Fix use-after-free in planShardedSearch Closed
Assigned Teams:
Query Optimization
Backwards Compatibility: Minor Change
Operating System: ALL
Backport Requested:
v5.0, v4.4
Sprint: QO 2023-04-03, QO 2023-04-17, QO 2023-05-01
Participants:

 Description   

Currently planShardedSearch is only implemented in 6.0+. Thus when a sharded cluster receives a $search query with sort, it does not support merge sorting on $searchSortValues as mongos never got a sortSpec from mongot, resulting in incorrect query results (potentially not sorted results).

The task of this ticket is to send a planShardedSearch request in sharded cluster in 5.0 to mongot, indicating to mongot that mongos does not support sort. Mongot will respond with an error if the query contains a sort, causing mongos to error out. This will solve the problem described above by returning an error rather than silently returning incorrect results.



 Comments   
Comment by Githook User [ 25/Apr/23 ]

Author:

{'name': 'Ben Shteinfeld', 'email': 'ben.shteinfeld@mongodb.com', 'username': 'bshteinfeld'}

Message: SERVER-75010 Introduce inShardedEnvironment() function to
MongoProcessInterface

This is a partial backport of
https://github.com/mongodb/mongo/commit/28c7db0e580afb4fe889f16370cf44c6f95f8cf3.

(cherry picked from commit 190f4f7f5def5af8ae8d992ddabaea06e216f743)
Branch: v4.4
https://github.com/mongodb/mongo/commit/a6e03c4a2f76ec9a40004a80dd670a065916a011

Comment by Githook User [ 07/Apr/23 ]

Author:

{'name': 'Ben Shteinfeld', 'email': 'ben.shteinfeld@mongodb.com', 'username': 'bshteinfeld'}

Message: SERVER-75010 Introduce inShardedEnvironment() function to
MongoProcessInterface

This is a partial backport of
https://github.com/mongodb/mongo/commit/28c7db0e580afb4fe889f16370cf44c6f95f8cf3.
Branch: v5.0
https://github.com/mongodb/mongo/commit/190f4f7f5def5af8ae8d992ddabaea06e216f743

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