Priority: Critical - P2
Affects Version/s: None
The migration logic on the donor shard that performs the initial index scan for documents to clone does not handle invalidations properly, and will generate a truncated set of documents to clone if the executor is killed during the index scan.
As a result, performing an index operation that invalidates plan executors at the same time that the initial index scan for a migration is yielding will cause some documents to not be transferred during the migration, and these documents will be deleted from the cluster during the next migration cleanup job.
The following index operations invalidate plan executors, and thus are able to trigger this issue:
- Dropping an index with the dropIndexes command.
- Aborting an index build with killOp().
- Updating the TTL configuration for an index with the collMod command.
This is a regression introduced in version 1.7.2 by 9923c7b6, and affects all versions released since.
The following script will reproduce this issue:
When run locally with version 3.2.1, the above script fails on the last line with the following: