[SERVER-9288] Count command records incorrect number of commands for top stats Created: 08/Apr/13 Updated: 14/Dec/16 Resolved: 14/Dec/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Diagnostics, Querying |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Shaun Verch | Assignee: | David Storch |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||
| Steps To Reproduce: | After dropDatabase:
After drop collection:
|
||||||||||||||||||||||||||
| Sprint: | Query 2017-01-23 | ||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||
| Description |
|
In different circumstances count will record a different number of commands. Usually it records two, except after the collection is dropped. I believe this is because the Client::Context::~Context destructor in client.cpp gets called twice: dbcommands.cpp 2001 execCommand Client::ReadContext This causes CurOp::recordGlobalTime to be called twice, which then calls Top::record twice. Also, the reason that count is only recorded once after a dropped collection because of an explicit check for this in Top::record. |
| Comments |
| Comment by David Storch [ 14/Dec/16 ] |
|
I can confirm that this has been fixed in master, 3.4, and 3.2, though I haven't tracked down exactly which change contained the fix. Closing as Gone Away. |
| Comment by Max Hirschhorn [ 14/Dec/16 ] |
|
I'm moving this ticket back into "Needs triage" for the Query team to take a look at. After reviewing the test cases for the "count" command in jstests/core/top.js as part of evaluating whether we could close |