[SERVER-24462] findAndModify does not update Top Created: 08/Jun/16  Updated: 23/May/18  Resolved: 15/Jul/16

Status: Closed
Project: Core Server
Component/s: Diagnostics, Querying
Affects Version/s: 3.1.2
Fix Version/s: 3.3.10

Type: Bug Priority: Minor - P4
Reporter: Kevin Albertson Assignee: Max Hirschhorn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-16063 Rewrite findAndModify Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

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)
Participants:
Case:

 Description   

Running findAndModify will not update the statistics shown in mongotop.



 Comments   
Comment by Githook User [ 15/Jul/16 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-24462 Record stats for the "top" command in findAndModify.
Branch: master
https://github.com/mongodb/mongo/commit/75be5358d7fb43ec1cd21249ccf47cf68e732826

Generated at Thu Feb 08 04:06:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.