Currently listIndexes includes in-progress background indexes that haven't been committed yet. This can theoretically (I haven't tested it) lead to an inconsistency in initial sync in the following scenario:
- Start bg index on primary
- Start initial sync
- Initial sync runs listIndexes and builds all returned indexes
- Initial sync finishes with the bg index
- Kill the bg index build on primary (or have it fail due to a recent insert)
I think after these steps, the secondary will have an index that the primary doesn't.