# Secondaries do not allow reads while applying the write operations

**URL:** <https://forums.percona.com/t/secondaries-do-not-allow-reads-while-applying-the-write-operations/5878>\
**Category:** Percona Server for MongoDB\
**Created:** [September 24, 2017, 11:34pm UTC](https://forums.percona.com/t/secondaries-do-not-allow-reads-while-applying-the-write-operations/5878 "2017-09-24T23:34:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mipa](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@mipa](https://forums.percona.com/u/mipa)\
**Post date:** [September 24, 2017, 11:34pm UTC](https://forums.percona.com/t/secondaries-do-not-allow-reads-while-applying-the-write-operations/5878/1 "2017-09-24T23:34:54Z")

</div>

Hi,

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] - [URL][https://docs.mongodb.com/manual/faq/concurrency/#how-granular-are-locks-in-mongodb[/URL]](https://docs.mongodb.com/manual/faq/concurrency/#how-granular-are-locks-in-mongodb%5B/URL%5D)

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.

Thanks,  
Michael
