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

Only check featureFlagSearchBatchSizeLimit once per thread

    • Type: Icon: Bug Bug
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • ALL
    • v8.0

      Came out of the QI feature flag audit. The feature flag is checked in mongot_cursor::establishCursorsForSearchStage(). This function can be called more than once per query, which would result in a feature flag check more than once per thread.

      We aren't supposed to check feature flags more than once per thread because the first feature flag check could return one result while a subsequent check returns a diff result (like if setFCV was interleaved between the two checks). 

      For example, we could have an outer pipeline with $search as the first stage and another $search within a subpipeline (e.g. unionWith/lookup). This would result in the search stages establishing two independent cursors on the mongot → establishCursorsForSearchStage() being executed twice for this query → possible feature flag divergence between the two cursors with a setFCV race.

            Assignee:
            will.buerger@mongodb.com Will Buerger
            Reporter:
            erin.liang@mongodb.com Erin Liang
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: