SBE BlockHashAggStage missing memory metrics

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Critical - P2
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • ALL
    • Hide

      Run telegraf with the attached configuration (you can install telegraf via apt on Linux)

      telegraf --config telegraf.conf
      

      Let it run for a few minutes while you have a mongod running.

      Then run the query above

      use telegraf;
      db.cpu.explain('executionStats').aggregate([
        { $match: { "tags.cpu": "cpu0" } },
        {
          $group: {
            _id: { $dateTrunc: { date: "$timestamp", unit: "hour" } },
            avgNonIdle: { $avg: { $subtract: [100, "$usage_idle"] } }
          }
        },
        {
          $project: {
            _id: 0,
            time: "$_id",
            avgNonIdle: 1
          }
        },
        { $sort: { time: 1 } }
      ]);
      
      Show
      Run telegraf with the attached configuration (you can install telegraf via apt on Linux) telegraf --config telegraf.conf Let it run for a few minutes while you have a mongod running. Then run the query above use telegraf; db.cpu.explain( 'executionStats' ).aggregate([ { $match: { "tags.cpu" : "cpu0" } }, { $group: { _id: { $dateTrunc: { date: "$timestamp" , unit: "hour" } }, avgNonIdle: { $avg: { $subtract: [100, "$usage_idle" ] } } } }, { $project: { _id: 0, time: "$_id" , avgNonIdle: 1 } }, { $sort: { time: 1 } } ]);
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When I run this query I should see memory metrics for the group stage, but I do not:

      db.cpu.explain('executionStats').aggregate([
        { $match: { "tags.cpu": "cpu0" } },
        {
          $group: {
            _id: { $dateTrunc: { date: "$timestamp", unit: "hour" } },
            avgNonIdle: { $avg: { $subtract: [100, "$usage_idle"] } }
          }
        },
        {
          $project: {
            _id: 0,
            time: "$_id",
            avgNonIdle: 1
          }
        },
        { $sort: { time: 1 } }
      ]);
      

      This query is on a collection produced by running telegraf configured to send CPU metrics to MongoDB.

      The output from explain('executionStats') looks like this, in part:

      {
        ...
        inputStage: {
          stage: "block_group",
          ...
          peakTrackedMemBytes: 0,
          ...
        }
      }
      

      For some reason it's not showing any memory used for the query, but there should be at least some. We should understand why. If I put $_internalInhibitOptimization between the match and the group stage, it uses the classic version of $group which does show memory usage.

            Assignee:
            Gil Alon
            Reporter:
            Chris Wolff
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: