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

Reconsider mongos approach to only incremental global counters for stages when aggregation is successful

    XMLWordPrintableJSON

Details

    • Query Integration

    Description

      The call to LiteParsedPipeline::tickGlobalStageCounters() depends on the status from running the pipeline being Status::OK(). This means the aggStageCounters won't be incremented if the aggregation pipeline errors. Not incrementing the aggStageCounters in mongos has made it challenging to identify from which mongos an aggregation a problematic aggregation (SERVER-82410) is being run in hopes to identify the particular application client triggering it (although we suspect Compass). Additionally, it is odd for mongos and mongod to have different behaviors when it comes to system observability.

      There may be downsides to having mongos increment its aggStageCounters even when the aggregation pipeline errors and so it is worth the Query team discussing internally to come to a decision again.

      627
      if (status.isOK()) {
      628
          updateHostsTargetedMetrics(opCtx,
      629
                                      namespaces.executionNss,
      630
                                      cri ? boost::make_optional(cri->cm) : boost::none,
      631
                                      involvedNamespaces);
      632
          // Report usage statistics for each stage in the pipeline.
      633
          liteParsedPipeline.tickGlobalStageCounters();
      634
          // Add 'command' object to explain output.
      635
          if (expCtx->explain) {
      636
              explain_common::appendIfRoom(
      637
                  aggregation_request_helper::serializeToCommandObj(request), "command", result);
      638
          }
      639
      }
      

      https://github.com/mongodb/mongo/blob/60a2f259be89aba194a2537037e464c96245b378/src/mongo/s/query/cluster_aggregate.cpp#L633

      Attachments

        Activity

          People

            vamsy.annabattula@mongodb.com Vamsy Annabattula
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated: