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

sbe_cmd.js does not check that queries return expected results, and the queries are returning the wrong results

    • Type: Icon: Improvement Improvement
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • Query Execution 2021-07-26, QE 2021-08-09, QE 2021-08-23, QE 2021-09-06, QE 2021-09-20, QE 2021-10-04, QE 2021-10-18

      The sbe_cmd.js test is our one test for checking that the test-only SBE command does something reasonable. This line in the test is verifying that the command runs correctly, but not that it returns the correct results. Also, this line is written incorrectly, since assert(db._sbe(slotBasedPlan)); is checking that the resulting DBCommandCursor is not undefined, which should always be true. Instead, we should call .itcount() or .toArray() on the cursor and check that the returned results are correct.

      I tried making this change, and discovered that the returned results are in fact not correct! It appears that the SBE plan returned by explain does not correctly roundtrip and result in the exact same execution plan. It is unclear how much effort we want to spend on the SBE test command in general, but we could consider looking into why exactly the SBE string returned by explain does not return the correct results when run via the SBE command.

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: