Global IS lock needed to read from CollectionCatalog in appendCollectionStorageStats

XMLWordPrintableJSON

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

      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
              Reporter:
              Henrik Edin
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

                Created:
                Updated:
                Resolved: