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

Possible race condition with multiple threads configuring the maximum size of the query stats store

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

      During SERVER-84314 we found that this is probably a possible race. Something like the following:

      T1: gets request, inserts query stats entry, calls counter.increment().
      T2: gets request, clears query stats store, evicting that entry. calls counter.resetToZero(), which then applies the atomic operation. _counter is now 0.
      T1: applies the atomic operation _counter.fetchAndAdd(1). _counter is now 1, even though the entry got evicted.

      I split it out into a follow-up ticket since this might be more widespread than just the query stats store, and also it's unclear how much we really care about it. I think the worst case scenario is that we end up out of sync between our serverStatus metrics and the actual truth of the size.

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

              Created:
              Updated:
              Resolved: