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

findAndModify does not update Top

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.3.10
    • Affects Version/s: 3.1.2
    • Component/s: Diagnostics, Querying
    • Labels:
      None
    • Fully Compatible
    • ALL
    • 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
    • Query 17 (07/15/16), Query 18 (08/05/16)

      Running findAndModify will not update the statistics shown in mongotop.

            Assignee:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: