Details
Description
As of SERVER-44911, an index operation (e.g. dropIndexes, createIndexes) will interrupt concurrent outgoing migrations. If a migration is interrupted in the critical section, it can lead to an fassert when the shard is running in FCV 4.2 (as described in SERVER-45752). This isn't a problem for index operations sent from a 4.4 binary mongos, because they will have a shard version and will wait for the critical section to complete. Operations from a 4.2 binary mongos (possible in a mixed version cluster) instead use the old protocol and are sent to all shards without a shard version, so they can bypass the critical section, interrupt a committing migration, and lead to the fassert.
Instead, only index operations sent from a 4.4 mongos should abort migrations, which can be differentiated by checking if the command was sent with a shard version using OperationShardingState::isOperationVersioned().