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

query stats store size serverStatus metric can go below 0

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.1, 7.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Query Optimization
    • Fully Compatible
    • v7.1
    • QI 2023-09-18

      My in-progress patch for SERVER-79736 reveals that making a copy of a QueryStatsEntry is permitted, and it will call the copy constructor which is compiler generated and will not increment the server status metric, but then it will eventually call the destructor which will update the server status metric in the negative direction. So I think this means that if you invoke $queryStats we'll make copies of everything and decrement the counters. My patch makes it worse

      It looks like the LRUKeyValue has a size tracker that could be customized to report metrics on its size, but it currently only exposes a customization option for the 'what is the size of this particular thing' part of it.

            Assignee:
            alyssa.clark@mongodb.com Alyssa Clark
            Reporter:
            memento@mongodb.com Memento Slack Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: