Not the answer you need?
Register and ask your own question!

Secondaries do not allow reads while applying the write operations

mipamipa ContributorInactive User Role Beginner
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
"In replication, MongoDB does not apply writes serially to secondaries. Secondaries collect oplog
entries in batches and then apply those batches in parallel. Secondaries do not allow reads while
applying the write operations, and apply write operations in the order that they appear in the oplog."
- https://docs.mongodb.com/manual/faq/concurrency/#how-granular-are-locks-in-mongodb

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
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.