[SERVER-46194] Applying transfer mods in a migration does not handle write conflicts Created: 14/Feb/20  Updated: 29/Oct/23  Resolved: 23/Mar/20

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.4.0-rc0, 4.2.9, 4.7.0

Type: Bug Priority: Major - P3
Reporter: Jack Mulrow Assignee: Alexander Taskov (Inactive)
Resolution: Fixed Votes: 0
Labels: sharding-4.4-stabilization
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4, v4.2
Sprint: Sharding 2020-03-23, Sharding 2020-04-06
Participants:
Linked BF Score: 24

 Description   

After cloning the initial documents in a chunk range, the recipient in a migration fetches any new writes in the range from the donor and applies them locally. For new inserts and updates, the recipient uses Helpers::upsert(), without handling write conflict exceptions, so a concurrent write to an already cloned document may abort the migration. This can happen in normal operation because multi writes targeted without the shard key are broadcast to all shards and do not filter orphans. I haven't reproduced this with transferred deletes, but from code inspection, the same problem seems possible.



 Comments   
Comment by Githook User [ 30/Jul/20 ]

Author:

{'name': 'Alex Taskov', 'email': 'alex.taskov@mongodb.com', 'username': 'alextaskov'}

Message: SERVER-46194 Applying transfer mods in a migration does not handle write conflicts

(cherry picked from commit 7dbcb6b464eaedb4061d5e470313d9bae21ff03d)
Branch: v4.2
https://github.com/mongodb/mongo/commit/dbd1e4182a6a2ba5efe7d9d8ae4b04afc6aa03bc

Comment by Matthew Saltz (Inactive) [ 23/Jul/20 ]

Requesting backport due to failure in a multiversion test suite with a migration from a 4.4 node to a 4.2 node

Comment by Githook User [ 25/Mar/20 ]

Author:

{'email': 'alex.taskov@mongodb.com', 'name': 'Alex Taskov', 'username': 'alextaskov'}

Message: SERVER-46194 Applying transfer mods in a migration does not handle write conflicts

(cherry picked from commit 7dbcb6b464eaedb4061d5e470313d9bae21ff03d)
Branch: v4.4
https://github.com/mongodb/mongo/commit/d7e99a30dc7fa02a971f3a8bb60c35e9f36d45c8

Comment by Githook User [ 23/Mar/20 ]

Author:

{'name': 'Alex Taskov', 'username': 'alextaskov', 'email': 'alex.taskov@mongodb.com'}

Message: SERVER-46194 Applying transfer mods in a migration does not handle write conflicts
Branch: master
https://github.com/mongodb/mongo/commit/7dbcb6b464eaedb4061d5e470313d9bae21ff03d

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