Data race on CollectionImpl::_committed

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.9.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Execution Team 2020-12-14
    • 16
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When UncommittedCollections commit a collection we install the new collection in the catalog here: https://github.com/mongodb/mongo/blob/1e6d0a856a9c9858552cdbdec889be14f4964b61/src/mongo/db/catalog/uncommitted_collections.cpp#L150-L151

      And later we set the committed flag in a commit handler: https://github.com/mongodb/mongo/blob/1e6d0a856a9c9858552cdbdec889be14f4964b61/src/mongo/db/catalog/uncommitted_collections.cpp#L161

      While still holding on to the MODE_IX lock.

      However, a lock-free reader may access this collection instance on a different thread and check CollectionImpl::_committed, causing a data race as this is not an atomic variable.

            Assignee:
            Henrik Edin
            Reporter:
            Henrik Edin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: