Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-14895

[SERVER] Investigate changes in SERVER-57037: Improve precision of operator counters

      Downstream Change Summary

      Operator counters for aggregate expressions were introduced previously. This patch improves the precision of the counters - there is no duplicate counting due to internal query processing or multiple documents. That may require small adjustments in the documentation text and examples.

      Description of Linked Ticket

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

            dave.cuthbert@mongodb.com Dave Cuthbert (Inactive)
            backlog-server-pm Backlog - Core Eng Program Management Team
            0 Vote for this issue
            4 Start watching this issue

              2 years, 5 days ago

                Error rendering 'slack.nextup.jira:slack-integration-plus'. Please contact your Jira administrators.