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

$collStats aggregation with storageStats always results in incrementing docUnitsRead

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 7.0.0-rc2
    • Component/s: None
    • None
    • Storage Execution
    • ALL

      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);
      

            Assignee:
            backlog-server-execution [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            matt.broadstone@mongodb.com Matt Broadstone
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: