Operational Defect Database

BugZero found this defect 2481 days ago.

MongoDB | 383223

[SERVER-29189] Top and op latency histogram counters are incorrect for getMore on an awaitData cursor

Last update date:


Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

No fixed releases provided.



The getMore path uses the AutoGetCollectionForReadCommand RAII helper, which on destruction updates Top and the appropriate per-collection latency histogram. It updates the stats by bumping the number of recorded reads, and recording the wall clock time between construction and destruction of the RAII object. For getMore on awaitData cursors, however, we release the AutoGetCollectionForReadCommand while blocking. This is to ensure that we do not hold collection locks while sleeping on a condition variable for potentially long periods of time. After waking up, the AutoGetCollectionForReadCommand is reacquired. The result is that we double-count each getMore operation in the Top diagnostic output. Furthermore, the time spent blocking for awaitData is not recorded. This is inconsistent with the global operation latency histogram reported by serverStatus(), which incorporates time spent blocking for awaitData.

Top User Comments

david.storch commented on Wed, 14 Jun 2017 22:58:13 +0000: This was fixed by SERVER-29304 and is now tested by getmore_awaitdata_opcounters.js. Resolving as a duplicate. david.storch commented on Fri, 19 May 2017 20:13:43 +0000: The changes related to reporting of latency for getMore on an awaitData cursor will be handled by related ticket SERVER-29304. Therefore, the scope of this ticket is now narrowed to cover the op counters problem only.

Additional Resources / Links


BugZero Risk Score

Coming soon



Have you been affected by this bug?


Do you know how much operational outages are costing you?

Understand the cost to your business and how BugZero can help you reduce those costs.


Login to read and write comments.

Have you ever...

had your data corrupted from a