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

Data race on CollectionImpl::_committed

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.9.0
    • None
    • None
    • None
    • Fully Compatible
    • ALL
    • Execution Team 2020-12-14
    • 16

    Description

      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.

      Attachments

        Activity

          People

            henrik.edin@mongodb.com Henrik Edin
            henrik.edin@mongodb.com Henrik Edin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: