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

Add function for the donor's "data sync" state and make donorStartMigration call the function

    • Fully Compatible
    • Sharding 2020-07-27

      This ticket is to:

      • Add a file migrating_tenant_donor_util.{h, cpp} to the serveronly_repl library
      • Add a function getTenantMigrationExecutor() to the file that returns a ThreadPoolTaskExecutor (see example). (This method of generating an executor is temporary and will be changed once we move the donor functions onto a Primary-Only Service.)
      • In the new file, add a free function "dataSync" that takes an OperationContext* and the donor's IDL type as an argument and does the following:
        • Send recipientSyncData to the recipient until success (it's ok if this is implemented as a TODO comment for now and a separate ticket is filed for it)
        • Create a MigratingTenantAccessBlocker (passing in an executor made using getTenantMigrationExecutor()) and call startBlockingWrites on it, then add() it to MigratingTenantAccessBlockerByPrefix with the database prefix
      • Call the free function from the donorStartMigration command.

      Add an integration test that calls donorStartMigration and uses serverStatus to check that the MigratingTenantAccessBlocker got added to the MigratingTenantAccessBlockerByPrefix and is in the "blockWrites" state.

       

            Assignee:
            luis.osta@mongodb.com Luis Osta (Inactive)
            Reporter:
            esha.maharishi@mongodb.com Esha Maharishi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: