[CBR] Tassert when CBR chooses plan that runs in SBE

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Blocker - P1
    • 8.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • Fully Compatible
    • ALL
    • Hide

       

      db.foo.drop()
      db.foo.createIndex({a:1})
      db.foo.createIndex({b:1})
      db.foo.insert({a: 5})
      db.adminCommand({setParameter: 1, planRankerMode: "automaticCE"})
      db.adminCommand({setParameter: 1, automaticCEPlanRankingStrategy: "CBRCostBasedRankerChoice"})
      db.foo.aggregate([{$match: {a: 5, b: 10}}, {$group: {_id: "$a"}}])
      // tassert
      

       

      Show
        db.foo.drop() db.foo.createIndex({a:1}) db.foo.createIndex({b:1}) db.foo.insert({a: 5}) db.adminCommand({setParameter: 1, planRankerMode: "automaticCE" }) db.adminCommand({setParameter: 1, automaticCEPlanRankingStrategy: "CBRCostBasedRankerChoice" }) db.foo.aggregate([{$match: {a: 5, b: 10}}, {$group: {_id: "$a" }}]) // tassert  
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The query in the repro gets lowered to SBE because of the $group. Based on the data/query I believe we do not switch to CBR in this case. The tassert happens with both CBRForNoMultiplanningResults and CBRCostBasedRankerChoice

      {"error":{"code":11451400,"codeName":"Location11451400","errmsg":"WorkingSet is not initialized"},"location":"src/mongo/db/query/plan_ranking/cbr_for_no_mp_results.cpp:112:59:std::unique_ptr<WorkingSet> mongo::plan_ranking::CBRForNoMPResultsStrategy::extractWorkingSet()"}}

            Assignee:
            Naafiyan Ahmed
            Reporter:
            Militsa Sotirova
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: