- Migration initiated.
- Migration cloneLocs phase complete.
- Destination finished cloning.
- New write comes in.
- New write passes shard version check inside the OpObserver hook.
- Donor sends commit command to destination.
- Destination sends _transferMods and gets an empty response, so it is ready to cleanup and complete the destination side of the migration.
- Doc _id of write is stored in transferMods buffer.
- New write returns success.
I believe the problem is because when we enter the critical section, we take IS lock on the ns:
That means that it can run in parallel with the new write that came in since it is compatible with IX.