[SERVER-14583] serverStatus().indexCounters not updating properly Created: 16/Jul/14  Updated: 20/Mar/15  Resolved: 20/Mar/15

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: 2.4.9, 2.6.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Andre Spiegel Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Operating System: ALL
Participants:

 Description   

The documentation says that the values in db.serverStatus().indexCounters should be updated each time an operation uses an index: http://docs.mongodb.org/manual/reference/command/serverStatus/#indexcounters

This is not happening. I tried creating a simple collection and performed a find() query on it, with and without an index. If the above is correct, at least the "accesses" counter should have been updated, but it doesn't change in either case.

The behavior is the same in both 2.4.9 and 2.6.1.



 Comments   
Comment by Ramon Fernandez Marina [ 20/Mar/15 ]

indexCounters was removed from the serverStatus() output in 3.0; see this comment for more details.

Comment by Ramon Fernandez Marina [ 04/Sep/14 ]

Thanks for confirming this is the actual issue andre.spiegel@10gen.com.

Comment by Andre Spiegel [ 04/Sep/14 ]

Correct, sorry for not responding. The above case is what I was seeing.

Comment by Ramon Fernandez Marina [ 19/Aug/14 ]

andre.spiegel@10gen.com, can you please verify whether the behavior described above is what you're seeing? If not, can you please post detailed information?

Thanks,
Ramón.

Comment by Ramon Fernandez Marina [ 08/Aug/14 ]

This is what I tried with 2.6.4-rc1:

db.foo.drop()
db.foo.ensureIndex({x:1})
db.serverStatus().indexCounters
for (i=0; i<10; i++) {db.foo.insert({x:i})}
db.serverStatus().indexCounters
db.serverStatus().indexCounters
{
        "accesses" : 42,
        "hits" : 42,
        "misses" : 0,
        "resets" : 0,
        "missRatio" : 0
}

Then I run the following, which I would expect it would increase some of the counters, but it wasn't the case:

db.foo.find({x:{$gt:5}})
db.serverStatus().indexCounters
{
        "accesses" : 42,
        "hits" : 42,
        "misses" : 0,
        "resets" : 0,
        "missRatio" : 0
}

andre.spiegel@10gen.com, is this the behavior you're seeing? If it's different, can you please provide a reproducer?

Generated at Thu Feb 08 03:35:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.