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

Global IS lock needed to read from CollectionCatalog in appendCollectionStorageStats

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • ALL
    • QE 2021-10-18
    • 145

      appendCollectionStorageStats reads from the CollectionCatalog without holding any locks:
      https://github.com/mongodb/mongo/blob/78ef9784e77a2411e8aa2b582bc80033f0f36228/src/mongo/db/stats/storage_stats.cpp#L58-L59

      This is not safe as there can be a writer with the global lock in exclusive mode modifying the CollectionCatalog in place. See: https://github.com/mongodb/mongo/blob/625072e57daff2a654df209b55602a2eba8054b2/src/mongo/db/catalog/collection_catalog.h#L126-L131

            Assignee:
            rui.liu@mongodb.com Rui Liu
            Reporter:
            henrik.edin@mongodb.com Henrik Edin
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: