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

Reverse mutex acquisition order in CatalogCache::_scheduleCollectionRefresh

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.6.13, 4.0.10
    • Fix Version/s: 3.6.14, 4.0.11
    • Component/s: Sharding
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.6
    • Sprint:
      Sharding 2019-07-15
    • Case:

      Description

      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

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: