Secondaries do not allow reads while applying the write operations


we’re running a sharded cluster and while the range deleter is running (after migration) it seems
that all connections and queries on the secondaries are frozen (lockwait). Since the delete takes
up to 15 or 20 minutes, all secondaries are unusable in this time.

After spending few hours on google I found [INDENT]“In replication, MongoDB does not apply writes serially to secondaries. Secondaries collect oplog [/INDENT] [INDENT]entries in batches and then apply those batches in parallel. Secondaries do not allow reads while [/INDENT] [INDENT]applying the write operations, and apply write operations in the order that they appear in the oplog.”[/INDENT] -

Can anybody explain why is that and maybe a workaround?

The primary is fully usable while the rangedeleter running, but as soon as it appears in the oplog
the slaves don’t even let me connect a mongo shell - stuck at authentication.