Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-13729

Reads & Writes are blocked during data file allocation on Windows

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.6.4, 2.7.2
    • Affects Version/s: None
    • Component/s: Storage
    • Fully Compatible
    • Windows
    • Server 2.7.2

      Issue Status as of Jul 18, 2014

      ISSUE SUMMARY
      On Windows, all reads and writes are blocked during data file allocation due to unecessary locking.

      USER IMPACT
      mongod stops processing all requests until I/O is completed. This has a negative performance impact, and if the blocking is too long it can impact heartbeats on replica sets.

      WORKAROUNDS
      N/A

      AFFECTED VERSIONS
      MongoDB production releases up to 2.6.3 are affected by this issue.

      FIX VERSION
      The fix is included in the 2.6.4 production release.

      RESOLUTION DETAILS
      Add a dedicated lock to handle the case of the race condition between _flushAll and the file being closed.

      Original description
      T1: Generic Query Thread: Holds: Nothing, Acquires DBLock(R), Waits on T2
      T2: AllocateFile Thread: Holds DBLock(W), Acquires: LockMongoFilesExclusive, Waits T3
      T3: Flush: Holds LockMongoFilesShared, Waits: I/O
      

      Problem: The MemoryMappedFile class needs to support concurrency, but was not correctly implemented so the wrong lock was used which causes unneeded synchronization.
      Fix: Add a dedicated lock to handle the case of the race condition between _flushAll, and the file being closed.
      Introduced in the fix for SERVER-7973

            Assignee:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Reporter:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: