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

$indexStats aggregations seem to increment the top counter twice

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • ALL
    • QE 2022-09-19

      This addition to jstests/core/top.js seems to cause it to fail:

      Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      diff --git a/jstests/core/top.js b/jstests/core/top.js
      index 20630f274c9..490865442e5 100644
      --- a/jstests/core/top.js
      +++ b/jstests/core/top.js
      @@ -125,11 +125,19 @@ for (i = 0; i < numRecords; i++) {
       }
       lastTop = assertTopDiffEq(testColl, lastTop, "commands", numRecords);
       
      +// aggregate
      +assert.eq(0, testColl.aggregate([]).itcount());  // All records were just deleted.
      +lastTop = assertTopDiffEq(testColl, lastTop, "commands", 1);
      +
       // getIndexes
       assert.eq(1, testColl.getIndexes().length);
       assertTopDiffEq(testColl, lastTop, "commands", 1);
       lastTop = assertTopDiffEq(testColl, lastTop, "readLock", 1);
       
      +// aggregate with $indexStats
      +assert.eq(1, testColl.aggregate([{$indexStats: {}}]).itcount());
      +lastTop = assertTopDiffEq(testColl, lastTop, "commands", 1);
      +
       // createIndex
      

      Specifically, that last assertion fails since "commands" is incremented by 2 instead of 1.

            Assignee:
            ivan.fefer@mongodb.com Ivan Fefer
            Reporter:
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: