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

It's unsafe to reuse OpCtx for multiple operations when queryStats is concurrently disabled

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • ALL
    • 30

      The fuzzer found this problem via the FTDC background thread which appears to run a couple back-to-back aggregation commands using the same OperationContext. What seems to be happening is the following:

      1. FTDC thread begins, and issues one aggregation which successfully records query stats.
      2. Another thread disables query stats by setting the cache size to 0.
      3. (back in FTDC) With the same OperationContext, but a different collector, we run a second aggregate.
      4. This second aggregate shares the old OperationContext (and CurOp, and OpDebug) which still has a query stats key hash on it, but will never have a query stats key, because query stats has been disabled.

      This doesn't cause too much trouble, it just causes us to miss that one recording for FTDC. The thread can continue without crashing or anything.

            Assignee:
            charlie.swanson@mongodb.com Charlie Swanson
            Reporter:
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: