[SERVER-49789] Make tenant migration donor use a StreamableReplicaSetMonitor to monitor and send commands to the recipient Created: 21/Jul/20  Updated: 29/Oct/23  Resolved: 04/Aug/20

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.7.0

Type: Improvement Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: Luis Osta (Inactive)
Resolution: Fixed Votes: 0
Labels: pm-1791_milestone-A
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-51440 Cleanup refcounting and lifetime of R... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2020-07-27, Sharding 2020-08-10
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 04/Aug/20 ]

Author:

{'name': 'Luis Osta', 'email': 'luis.osta@mongodb.com', 'username': 'LuisOsta'}

Message: SERVER-49789 Make tenant migration donor use a StreamableReplicaSetMonitor to monitor and send commands to the recipient
Branch: master
https://github.com/mongodb/mongo/commit/0e3bd22e59a51dcdfc7fdac6d96dcda22e2e6647

Generated at Thu Feb 08 05:20:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.