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

Race condition on _sessionCatalogSource in LogOpShardingHandler::commit

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible

      The LogOpShardingHandler::commit method checks if the _sessionCatalogSource
       member from the `MigrationChunkClonerSourceLegacy` class is constructed, but that member may be in the process of being constructed (via the MigrationChunkClonerSourceLegacy::startClone method). This is a race condition because the check may succeed because the memory address for _sessionCatalogSource has some data written, but not all of the data may have been finished being written, so using it would be unsafe.

      Note that other methods in MigrationChunkClonerSource that do a similar check for if the sessionCatalgSource exists are not racy because they are assumed to be running after startClone is ran (which is the only method that constructs the _sessionCatalogSource).

       

            Assignee:
            wenqin.ye@mongodb.com Wenqin Ye
            Reporter:
            wenqin.ye@mongodb.com Wenqin Ye
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: