[SERVER-56082] [sbe][sharding_op_query] tassert because SBE does not support ENSURE_SORTED Created: 13/Apr/21  Updated: 29/Oct/23  Resolved: 15/Apr/21

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 5.0.0-rc0

Type: Task Priority: Major - P3
Reporter: Kyle Suarez Assignee: Eric Cox (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-56117 Enable sharding_auth_audit suite agai... Closed
Related
is related to SERVER-56048 [SBE][unittest] db_s_shard_server_tes... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query Execution 2021-04-19
Participants:

 Description   

The ENSURE_SORTED stage is a PlanStage that drops results that are not in sorted order. I believe we only add this node when the server receives an OP_QUERY with an nToReturn specified on a sorted OR query.

The tests linked here all fail because SBE doesn't support ENSURE_SORTED. One possible solution would be to detect these types of plans earlier, and fall back to the classic engine if possible.

[js_test:merge_chunks_test] uncaught exception: Error: error: {
[js_test:merge_chunks_test] 	"$err" : "Encountered non-retryable error during query :: caused by :: Unsupported QSN in SBE stage builder: ENSURE_SORTED\n---pattern = { time: -1.0 }\n---nodeId = 6\n---fetched = 1\n---sortedByDiskLoc = 0\n---providedSorts = {baseSortPattern: {}, ignoredFields: []}\n---Child:\n------OR\n---------nodeId = 5\n---------fetched = 1\n---------sortedByDiskLoc = 0\n---------providedSorts = {baseSortPattern: {}, ignoredFields: []}\n---------Child 0:\n------------SORT\n---------------type = DEFAULT\n---------------pattern = { time: -1.0 }\n---------------limit = 5\n---------------nodeId = 2\n---------------fetched = 1\n---------------sortedByDiskLoc = 0\n---------------providedSorts = {baseSortPattern: {}, ignoredFields: []}\n---------------Child:\n------------------COLLSCAN\n---------------------ns = config.actionlog\n---------------------filter = what $eq \"balancer.round\"\n---------------------nodeId = 1\n---------------------fetched = 1\n---------------------sortedByDiskLoc = 0\n---------------------providedSorts = {baseSortPattern: {}, ignoredFields: []}\n\n---------Child 1:\n------------SORT\n---------------type = DEFAULT\n---------------pattern = { time: -1.0 }\n---------------limit = 0\n---------------nodeId = 4\n---------------fetched = 1\n---------------sortedByDiskLoc = 0\n---------------providedSorts = {baseSortPattern: {}, ignoredFields: []}\n---------------Child:\n------------------COLLSCAN\n---------------------ns = config.actionlog\n---------------------filter = what $eq \"balancer.round\"\n---------------------nodeId = 3\n---------------------fetched = 1\n---------------------sortedByDiskLoc = 0\n---------------------providedSorts = {baseSortPattern: {}, ignoredFields: []}\n\n",
[js_test:merge_chunks_test] 	"code" : 4822884
[js_test:merge_chunks_test] } :

List of tests failing in the sharding_op_query suite:

  • jstests/sharding/merge_chunks_test.js (task)
  • jstests/sharding/bulk_shard_insert.js (task)


 Comments   
Comment by Eric Cox (Inactive) [ 15/Apr/21 ]

Closing since this was fixed in SERVER-56048.

Comment by Eric Cox (Inactive) [ 14/Apr/21 ]

Both of the failing tests listed pass given the change proposed in SERVER-56048.

Generated at Thu Feb 08 05:38:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.