`$search` queries with a specified `sort` in sharded clusters will now fail instead of silently return incorrect results.
Description of Linked Ticket
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.
- documents
-
SERVER-75010 Implement no-op planShardedSearch in 5.0
- Closed