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

Improve precision of operator counters

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.2.0, 5.1.2, 5.0.6
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Backport Requested:
      v5.1, v5.0, v4.4, v4.2
    • Sprint:
      Query Optimization 2021-06-28, Query Optimization 2021-07-12, Query Optimization 2021-07-26, QO 2021-09-06, Query Optimization 2021-08-09, QO 2021-09-20, QO 2021-10-04, QO 2021-10-18, QO 2021-11-01, QO 2021-08-23

      Description

      SERVER-56422 introduced operator counters for aggregate expressions using the moment of parsing of an expression to increment its counter. Since in some cases expressions are parsed multiple times during query processing, the counter value overestimates the true expression occurrence.

      The goal of this task is to implement an alternative idea with more precise counter increment using the CurOp class. The idea of Charlie is to 

      • Add counter map to the CurOp object.
      • Add APIs to CurOp to #1 increment counters and #2 transition to "parsing stats collection is over - do not track", which we can call to lock them into place once we're done the first complete parsing. e.g. in runAggregate() or FindCmd::run().
      • Once in this state any requests to increment the counters won't do anything so the code will still look pretty simple from within parseExpression().
      • Finally transition the stats from the CurOp object into the serverStatus counters during 'completeAndLogOperation'.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              milena.ivanova Milena Ivanova
              Reporter:
              milena.ivanova Milena Ivanova
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: