[SERVER-21305] Lock 'timeAcquiringMicros' value is much higher than the actual time spent Created: 05/Nov/15  Updated: 22/Apr/16  Resolved: 09/Nov/15

Status: Closed
Project: Core Server
Component/s: Concurrency
Affects Version/s: 3.0.7, 3.2.0-rc2
Fix Version/s: 3.0.8, 3.2.0-rc3

Type: Bug Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Geert Bosch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
is duplicated by SERVER-20386 Mongo lock stat timeAcquiringMicros w... Closed
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Sprint: QuInt C (11/23/15)
Participants:

 Description   

This is present both in 3.0 and in 3.2 (master), but not in 2.6 or earlier.

For each wait which is more than a second, MongoDB will report the sum of arithmetic progression of all 500 msec increments of the wait, so basically we report approximately a square of the actual wait time.

It happens on this line. For lock waits, we wake up every 500 milliseconds to check for deadlock and to also update the wait time counters so that if a thread is blocked for a long time, the currentOp statistics will reflect that. The bug is in that we do not reset the last sample timestamp and so the time keeps accumulating.

The workaround until we fix it would be to take the square root of the wait time reported in the lock info.



 Comments   
Comment by Githook User [ 09/Nov/15 ]

Author:

{u'username': u'GeertBosch', u'name': u'Geert Bosch', u'email': u'geert@mongodb.com'}

Message: SERVER-21305: Correctly calculate lock acquisition time for long waits

(cherry picked from commit ba231028314553f1495e6583d5a59c55919a764c)
Branch: v3.0
https://github.com/mongodb/mongo/commit/52d45c750df0d10634c9939d75b68a260815c78e

Comment by Githook User [ 09/Nov/15 ]

Author:

{u'username': u'GeertBosch', u'name': u'Geert Bosch', u'email': u'geert@mongodb.com'}

Message: SERVER-21305: Correctly calculate lock acquisition time for long waits
Branch: master
https://github.com/mongodb/mongo/commit/ba231028314553f1495e6583d5a59c55919a764c

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