ISSUE SUMMARY
For MongoDB instances running on Windows, MongoDB takes a global mutex that blocks all requests during the background flush of database files to disk.
USER IMPACT
Database reads, and writes block during background flushes. Users will see long request times while requests wait for the background database flush to finish.
WORKAROUNDS
N/A
AFFECTED VERSIONS
All versions of MongoDB prior to 2.6.4 are affected by this issue.
FIX VERSION
The fix is included in the 2.6.4 production release.
RESOLUTION DETAILS
A unnecessary lock was removed from the product.
Original description
MongoDB has low CPU usage and does not process requests while a background flush is proceeding.
The cause of this has been identified as the following blocking chain:
T1: Generic Query Thread: Holds: Nothing, Acquires DBLock(R), Waits on T2 T2: WRITEDATAFILES Thread: Holds DBLock(W). Acquires: GlobalFlushMutex, Waits T3 T3: Flush: Holds Global Flush Mutex, Waits: I/O
The lock was originally added in SERVER-7378 to workaround a bug in the Windows Azure Storage driver . It has been confirmed by Microsoft that there is a bug in the driver that only affects (a) memory mapped files such as MongoDB databases which are (b) concurrently updated while flushing to (c) a drive that is hosted on a Azure disk that does not set host cache preference to read/write.
We have removed the SERVER-7378 workaround since it penalizes all Windows deployment scenarios, including all scenarios where there is no bug (like bare-metal, other cloud providers, etc).
- is depended on by
-
SERVER-9868 heartbeats not responded to during mmap flushing on Windows
- Closed
-
SERVER-12880 Server pauses on requests every 60 seconds
- Closed
-
SERVER-13444 Long locked flush without inserts and updates
- Closed
- related to
-
SERVER-9355 Mongodb crashed after - FlushViewOfFile for F:/data/xq.4 failed with error 1117 after 1 attempts taking 7076 ms
- Closed