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

Ensure that tenant migration donor only removes a ReplicaSetMonitor for a recipient when the last migration to that recipient completes

    • Fully Compatible
    • Sharding 2020-10-19, Sharding 2020-11-02, Sharding 2020-11-16, Sharding 2020-11-30, Sharding 2020-12-14
    • 17

      SERVER-49789 made a TenantMigrationDonorService::Instance create a RemoteCommandTargeterRS for the recipient replica set at the beginning of its run() and capture the targeter into all the continuations in its future chain (like here).

      See that ticket's description for background.

      We handled destroying the donor's ReplicaSetMonitor for the recipient once the donor completed the migration by calling ReplicaSetMonitor::remove in the RemoteCommandTargeterRS destructor.

      However, if the donor was migrating two tenants to the same recipient concurrently, the two migrations would be sharing the same ReplicaSetMonitor, and the first migration to finish would rip the ReplicaSetMonitor out from under the second migration.

      This ticket is to ensure the ReplicaSetMonitor is only removed when the ReplicasSetMonitor does not have any more users.

      There is already a commented-out test case for this here.

            Assignee:
            andrew.shuvalov@mongodb.com Andrew Shuvalov (Inactive)
            Reporter:
            cheahuychou.mao@mongodb.com Cheahuychou Mao
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: