Priority: Major - P3
Resolution: Won't Fix
Affects Version/s: 3.7.6
Fix Version/s: None
Currently, the MigrationSourceManager forces a fresh of sharding metadata after a commit has been attempted, no matter whether the commit succeeds or fails. A refresh is costly and shouldn't be necessary every time.
Instead, we should do the following:
- After a commit attempt (both success AND failure), clear the shard version on the source shard.
- On a successful commit, return without refreshing.
- On a failed commit, return the commit status.
That assures the following behavior:
If the commit fails, then when attempting to access this chunk, the source shard will refresh from the config server and reassume ownership for that chunk.
If the commit succeeds, then when attempting to access this chunk, the source shard will refresh from the config server and find out it's not the owner of the chunk. The mongos will then reroute access to the destination shard.