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

Data race on rename collection participant

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0
    • Affects Version/s: 5.0.0, 6.0.0, 7.0.0-rc0
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Sharding EMEA 2023-05-01
    • 135
    • None
    • 0
    • None
    • None
    • None
    • None
    • None
    • None

      When shardsvr_rename_collection_participant command is called, first it calls getOrCreate, which returns an instance of a {{renameCollectionParticipant }}running asynchronously, then it checks if the parameters of the request are the same than the parameters of the given instance (to ensure idempotency).

      Since the check is done while the renameCollectionParticipant is being executed on another thread, there is a data race over _doc attribute:

       

      CONSEQUENCES OF THE BUG:

      In case of reading a defective _doc value due to a data race the DDL coordinator will retry the command here.

       

      A suggestion to fix this bug is to add a const attribute (which could be called _request) and initiate it on the constructor using the _doc value, similar to what RenameCollectionCoordinator already does (1) (2).

            Assignee:
            silvia.surroca@mongodb.com Silvia Surroca
            Reporter:
            silvia.surroca@mongodb.com Silvia Surroca
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: