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

$collStats aggregation with storageStats always results in incrementing docUnitsRead

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • 7.0.0-rc2
    • None
    • None
    • Storage Execution
    • ALL

    Description

      When converting from using the legacy collStats command to the $collStats aggregation stage, end-to-end tests have identified that calling the aggregation stage consistently increases docUnitsRead in v7.0 builds of the server. We can reproduce the issue with the following script:

      const node = MongoRunner.runMongod({
        setParameter: { aggregateOperationResourceConsumptionMetrics: true }
      });
       
      const admin = node.getDB("admin");
      const db = node.getDB("foo");
       
      // add some data to the collection
      assert.commandWorked(db.bar.insert({}));
       
      // run test
      const first = admin.aggregate([{ $operationMetrics: {} }]).next();
      db.bar.aggregate([{ "$collStats": { "storageStats": {} } }]);
      const second = admin.aggregate([{ $operationMetrics: {} }]).next();
      assert.eq(first.db, second.db);
      assert.eq(first.primaryMetrics.docUnitsRead, second.primaryMetrics.docUnitsRead);
       
      MongoRunner.stopMongod(node);
      

      Attachments

        Activity

          People

            backlog-server-execution Backlog - Storage Execution Team
            matt.broadstone@mongodb.com Matt Broadstone
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: