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

Don't refresh database and collection information from config server while holding a mutex

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.4.4, 3.5.6
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Fully Compatible
    • ALL
    • v3.4
    • Sharding 2016-12-12, Sharding 2017-01-02, Sharding 2017-02-13, Sharding 2017-03-06, Sharding 2017-03-27, Sharding 2017-04-17

      CatalogCache::getDatabase loads database metadata under the CatalogCache's mutex, blocking all operations while the config server query completes. This alone is pretty bad, but at least the CatalogCache shouldn't miss too often (CatalogCache caches database objects, database creation should be relatively infrequent).

      Even worse is the reloading of the ChunkManager, which loads the chunk ranges under the DBConfig's mutex. This means that while we are loading the chunk ranges for a collection after a shard version error, all CRUD operations on all (sharded or unsharded) collections in that database will block until the chunk reload is finished.

            Assignee:
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Reporter:
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            9 Vote for this issue
            Watchers:
            28 Start watching this issue

              Created:
              Updated:
              Resolved: