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

Deadlock due to KVDatabaseCatalogEntry doing blocking transactional operations under the _collectionsLock

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.8.0-rc5
    • Affects Version/s: None
    • Component/s: Storage
    • Fully Compatible
    • ALL

      See the attached stack dump file.

      KVDatabaseCatalogEntry::sizeOnDisk is called under the KVDatabaseCatalogEntry::_collectionsLock in thread #16, but we are under a WT transaction there (i.e. snapshot is being held).

      The code which already holds the _collectionsLock (threads #13 or #15) is stuck on eviction. Eviction cannot proceed because of the transaction started by thread #16, but thread #16 cannot make progress because it's stuck on the _collectionsLock.

      The solution would be to not call WT methods under this mutex.

      I believe the list of collections should be stable, because we are under the DB IX lock and adding a collection requires DB X lock, so we can completely get rid of this mutex.

            Assignee:
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Reporter:
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: