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

Make tenant migration donor use a StreamableReplicaSetMonitor to monitor and send commands to the recipient

    • Fully Compatible
    • Sharding 2020-07-27, Sharding 2020-08-10

      The donor will receive the recipient's connection string in the donorStartMigration command and use it to send the recipientSyncData and recipientForgetMigration commands to the recipient primary.

      Background on inter-replica set communication

      To target a command to a remote replica set by read preference, a node can create a  RemoteCommandTargeterRS (see example of creating one from a connection string).

      The RemoteCommandTargeter constructor creates and registers a ReplicaSetMonitor on the ReplicaSetMonitorManager, which is a decoration the ServiceContext. (A ReplicaSetMonitor should also be removed from the ReplicaSetMonitorManager when it's no longer needed.)

      The RemoteCommandTargeter exposes methods to find a host in the replica set matching a particular read preference (these methods use the ReplicaSetMonitor under the hood).

      Code can use the RemoteCommandTargeter to find a host, then run a command against that host over a TaskExecutor.

      This ticket

      This ticket is to have the donor send some command (since recipientSyncData doesn't exist yet) to the recipient's primary over the tenant migration executor and verify from a jstest that the command was sent. One option is to send a setFCV command, as is done here, and verify the recipient's FCV changed in the test. Another option is to send an insert and verify the document gets inserted.

      Note that there are currently two ReplicaSetMonitor implementations, and ReplicaSetMonitorManager creates StreamableReplicaSetMonitors by default.

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

              Created:
              Updated:
              Resolved: