-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
v5.1
-
Server Serverless 2021-10-18, Server Serverless 2021-10-25, Server Serverless 2021-11-01, Server Serverless 2021-11-15, Server Serverless 2021-11-29, Server Serverless 2021-12-13
The multitenant migrations process begins when Cloud calls donorStartMigration on the donor primary with a tenantId. The donor calls recipientSyncData on the recipient primary with the tenantId. On both sides, we have ugly code for preventing concurrent migrations with the same tenantId. In SERVER-60752 we added an API to make such conflict-detection cleaner.
This ticket will need at least 3 commits:
- Using the new API introduced in
SERVER-60752, clean up the conflict detection code in the recipientSyncData command. The change we made in the donorStartMigration command inSERVER-60752is a good example to start from. - The donorStartMigration command already uses the new API to ban multiple migrations with the same tenantId. (Well, once
SERVER-60752is committed.) We're adding a new concept of the migration "protocol", which can be "multitenant migrations" (old protocol, the default) or "shard merge" (the new one). Add a new rule: if any active migration has protocol "shard merge" it must be the only migration - other migrations are banned regardless of their protocol or tenantId. So if there's any existing migration then a new "shard merge" is banned. If there's an existing "shard merge", any new migration is banned. - Same change as #2, but for recipientSyncData.
- depends on
-
SERVER-60752 API for detecting conflicts among PrimaryOnlyService instances
- Closed