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

Reverse mutex acquisition order in CatalogCache::_scheduleCollectionRefresh

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.14, 4.0.11
    • Affects Version/s: 3.6.13, 4.0.10
    • Component/s: Sharding
    • None
    • Fully Compatible
    • ALL
    • v3.6
    • Sharding 2019-07-15

      CatalogCache::_scheduleCollectionRefresh holds CatalogCache::_mutex while calling ShardServerCatalogCacheLoader::getsChunkSince, which will try to grab ShardServerCCL::_mutex at the beginning:
      https://github.com/mongodb/mongo/blob/r4.0.10/src/mongo/s/catalog_cache.cpp#L603

      Inside async task, tries to run callback while holding ShardServerCLL::_mutex:
      https://github.com/mongodb/mongo/blob/r4.0.10/src/mongo/db/s/shard_server_catalog_cache_loader.cpp#L416

      and the callback tries to grab the CatalogCache::_mutex:
      https://github.com/mongodb/mongo/blob/r4.0.10/src/mongo/s/catalog_cache.cpp#L577

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

              Created:
              Updated:
              Resolved: