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

Fix inaccurate comment relating to SEARCH_META handling in SBE stage builder

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 6.0.0-rc0
    • None
    • None
    • Fully Compatible
    • QE 2022-03-07

    Description

      This comment implies that the value of the SEARCH_META variable in the SBE RuntimeEnvironment can be set later on. That's not true. There is no downstream code to set the SEARCH_META value. And if there is a value for SEARCH_META inside ExpressionContext::variables, it will already have been set in the RuntimeEnvironment here.

      After discussing with mihai.andrei, he explained that this code is actually a special case to handle non-$search queries which refer to SEARCH_META. We have an example test in the enterprise modules here. SEARCH_META is supposed to resolve to "missing" for non-$search queries. We currently deal with this in the SBE stage builder by establishing a missing value in the RuntimeEnvironment and then referring to this runtime environment slot later in the SBE plan. We should update the comment to correctly explain why this code exists.

      Attachments

        Activity

          People

            mihai.andrei@mongodb.com Mihai Andrei
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: