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

Re-introduce SBE feature flag

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution

      Once SERVER-66583 is complete, we will be in the following situation:

      • internalQueryForceClassicEngine will default to false. This means that SBE is enabled in pretty much all build variants. However, only queries involving $lookup/$group pushdown will actually use SBE. All others will fall back to the classic engine.
      • There is a special build variant that tests the system with internalQueryForceClassicEngine set to true. This is important to ensure that everything continues to work even if SBE is forced off entirely.

      This leaves us with the following problem: We have lost test coverage for a wide swath of queries that were formerly eligible to run in SBE, but have been made ineligible as part of ensuring 6.0 release readiness. We need to restore this test coverage, both for correctness and performance. I propose the following:

      • Introduce a new feature flag called something like featureFlagSbeAdditionalScenarios. Maybe someone can come up with a better name. Like feature flags in general, it will be false by default but switched on auto-magically in the "all feature flags" correctness and performance builders.
      • If this feature flag is on, then we use SBE for the same kinds of queries that were formerly using SBE in the 5.1.x, 5.2.x, and 5.3.x releases. This means that most find commands will use SBE, unless they fall into a handful of special cases (an unsupported expression, oplog queries, positional path components, etc.).
      • The internalQueryForceClassicEngine should override featureFlagSbeAdditionalScenarios. That is, when internalQueryForceClassicEngine is enabled, SBE should be completed forced off and the value of featureFlagSbeAdditionalScenarios is irrelevant.

      Reiterating the decision logic by which we decide whether or not to use SBE: If internalQueryForceClassicEngine is on, use the classic engine. Otherwise, if the query is inherently SBE ineligible, use the classic engine. Otherwise, if featureFlagSbeAdditionalScenarios is false and $lookup/$group are not being pushed down, use the classic engine. Otherwise use SBE.

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

              Created:
              Updated:
              Resolved: