Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-56082

[sbe][sharding_op_query] tassert because SBE does not support ENSURE_SORTED

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.0.0-rc0
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • Fully Compatible
    • Query Execution 2021-04-19

      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)

            Assignee:
            eric.cox@mongodb.com Eric Cox (Inactive)
            Reporter:
            kyle.suarez@mongodb.com Kyle Suarez
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: