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

[CQF] Sampling CE may cause a MONGO_UNREACHABLE to be reached / segfault in traverseF

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • ALL
    • QE 2022-10-31, QE 2022-11-14, QE 2022-11-28, QE 2022-12-12, QE 2022-12-26

      During SERVER-68516, an integration test with the following pipeline was written:

      coll.aggregate([              
      {$project: {a: {$literal: [1, 2, 3, 4]}}},              
      {$match: {a: {$elemMatch: {$gte: 2, $lte: 3}}}}          
      ])

      On Evergreen (I cannot reproduce this locally), this test with the internalQueryCardinalityEstimatorMode default set as sampling fails (the test is in jstests/cqf/computed_projection.js) as seen in this patch. The issue from the logs seems to be that we are in sampling CE code and the MONGO_UNREACHABLE here (in the SBE codebase) is reached.

      Setting that default to heuristic, as done in this patch, results in that test passing.

      During my investigation to see what type is being passed into typeToTags() such that we end up at the MONGO_UNREACHABLE, the type printed in the Evergreen logsĀ  was "unknown tag" which seems to be coming from this printer function. However, every case of the TypeTags enum is represented in that function (except for EndOfShallowValues, which equals MaxKey) so it is not clear what is being passed into typeToTags() when we get to the MONGO_UNREACHABLE.

        1. server-70582-debug.patch
          52 kB
        2. server-70582-stack
          46 kB

            Assignee:
            andrew.paroski@mongodb.com Drew Paroski
            Reporter:
            militsa.sotirova@mongodb.com Militsa Sotirova
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: