[SERVER-59786] Prevent concurrent merges Created: 03/Sep/21  Updated: 29/Oct/23  Resolved: 02/Dec/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.2.0-rc0

Type: Task Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Christopher Caplinger
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
depends on SERVER-60752 API for detecting conflicts among Pri... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.1
Sprint: 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
Participants:

 Description   

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:

  1. 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 in SERVER-60752 is a good example to start from.
  2. The donorStartMigration command already uses the new API to ban multiple migrations with the same tenantId. (Well, once SERVER-60752 is 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.
  3. Same change as #2, but for recipientSyncData.


 Comments   
Comment by Githook User [ 02/Dec/21 ]

Author:

{'name': 'Christopher Caplinger', 'email': 'christopher.caplinger@mongodb.com', 'username': 'UnicodeSnowman'}

Message: SERVER-59786: Prevent concurrent merges
Branch: master
https://github.com/mongodb/mongo/commit/ac9a64634fb87fa4b065c0e83c50c7b4d1400688

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