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

Only check queryStats feature flag once per thread

    • Type: Icon: Task Task
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • v8.0

      Came out of the QI feature flag audit.  To make it more clear that the queryStats feature flag checks do not race with the setFCV commands during upgrades/downgrades, we should consider rewriting the feature flag checks to do one feature flag check when registering the request and to persist this decision for the lifetime of the thread. This helps prevent strange bugs like BF-30856 and the resulting special fixes for these complicated feature flag race scenarios.

      e.g. It looks like the feature flag can flip flop between calls of DocumentSourceQueryStats::doGetNext()., aka while iterating between partitions of the QueryStats store.  It’s possible that the feature flag was enabled in query_stats::registerRequest(), but has been disabled if a downgrade happens while reading the QueryStatsStore. In that case we will uassert and end the operation prematurely. This is intended, but could result in something similar to BF-30856 if state wasn't cleared properly.

            Assignee:
            Unassigned Unassigned
            Reporter:
            erin.liang@mongodb.com Erin Liang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: