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

ReplicationCoordinatorImpl should hold DataReplicator with shared pointer

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.15
    • Affects Version/s: None
    • Component/s: Replication
    • None
    • Fully Compatible
    • ALL
    • Repl 2016-08-29, Repl 2016-09-19, Repl 2016-10-10

      The ReplicationCoordinatorImpl currently uses a unique pointer to hold onto the DataReplicator. When we call doInitialSync, the pointer is not locked, so another thread could reset the pointer before the call, like resync.

      Using a shared pointer will fix this and make it so we no longer needed to synchronize on the pointer use, only when replaced/swapped. Each user of the current DataReplicator would make a copy of the shared_ptr which will stay valid. The sequence of events

      Tests
      A test to prove correctness will be concurrent resync requests during initial sync, or at all. Each resync will stop an existing initial-sync/resync and start a new initial sync, optionally waiting till completion.

            Assignee:
            scotthernandez Scott Hernandez (Inactive)
            Reporter:
            judah.schvimer@mongodb.com Judah Schvimer
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: