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

findAndModify does not update Top

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 3.1.2
    • Fix Version/s: 3.3.10
    • Component/s: Diagnostics, Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      As a simple example, running the following script alongside mongotop will show no increase in top statistics:

      db.toptest.insert({a:1});
      for (var i = 0; i < 100000; i++) {
          db.toptest.findAndModify({
              query:{a:{$gt:0}},
              update:{$inc:{a:1}}
          });
      }
      

      mongotop will consistently show

      ns total read write 2016-06-08T09:59:48-04:00
      test.toptest 0ms 0ms 0ms

      Meanwhile, running the similar script with update instead shows an increase in top statistics:

      for (var i = 0; i < 100000; i++) {
          db.toptest.update({a:{$gt:0}}, {$inc:{a:1}});
      }
      

      ns total read write 2016-06-08T10:04:47-04:00
      test.toptest 197ms 0ms 197ms

      Show
      As a simple example, running the following script alongside mongotop will show no increase in top statistics: db.toptest.insert({a:1}); for ( var i = 0; i < 100000; i++) { db.toptest.findAndModify({ query:{a:{$gt:0}}, update:{$inc:{a:1}} }); } mongotop will consistently show ns total read write 2016-06-08T09:59:48-04:00 test.toptest 0ms 0ms 0ms Meanwhile, running the similar script with update instead shows an increase in top statistics: for ( var i = 0; i < 100000; i++) { db.toptest.update({a:{$gt:0}}, {$inc:{a:1}}); } ns total read write 2016-06-08T10:04:47-04:00 test.toptest 197ms 0ms 197ms
    • Sprint:
      Query 17 (07/15/16), Query 18 (08/05/16)
    • Case:

      Description

      Running findAndModify will not update the statistics shown in mongotop.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: