A replicated dropIndexes operation, performed on a collection that is currently performing a background index build, will block replication and all read operations to that member for the duration of the index build.
- Perform a background index build.
- Once completed on the primary and once the background build has started on a secondary, run dropIndexes against the primary.
- The dropIndexes being a quick operation will replicate to the secondary while the index build is in progress (for any long running index build).
- Once the secondary receives the dropIndexes via replication, reads will be blocked across all namespaces and replication will halt. This persists until the background index build completes and the dropIndexes is allowed to execute.