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

Improve precision of operator counters

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.4.14, 5.2.0, 5.1.2, 5.0.6, 4.4.13
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • v5.1, v5.0, v4.4, v4.2
    • 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

      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'.

            milena.ivanova@mongodb.com Milena Ivanova
            milena.ivanova@mongodb.com Milena Ivanova
            0 Vote for this issue
            7 Start watching this issue