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.
- causes
-
SERVER-80499 Fix use-after-free in planShardedSearch
- Closed
- depends on
-
SERVER-75404 Designate $searchSortValues as metadata field on v5.0
- Closed