How to detect Replication failures (if any) in MongoDB?

72 views
Skip to first unread message

Karthik Bhat

unread,
Aug 26, 2015, 1:31:03 AM8/26/15
to mongodb-user
How to detect Replication failures between primary and secondary nodes in mongo (if any)? Can you please point me to the documentation?

Nikhil R

unread,
Aug 26, 2015, 4:35:31 AM8/26/15
to mongodb-user
Replication failures generally happens when the Primary node is down and the members of replica sets takes around 10-30 secs to acknowledge the in accessibility of the Primary node.
Then, the members of replica sets will hold an election to select the Primary node. This is when the MongoDB will not be available for writes. 
So the total time taken for the entire process above is around 1 min.
You can get this info in the mongodb logs of the nodes.

-Nikhil

Asya Kamsky

unread,
Aug 31, 2015, 2:03:24 AM8/31/15
to mongodb-user
What exactly do you mean by replication failures? MongoDB
replication is designed in such a way that if a secondary fails to
successfully apply an operation from the primary it will NOT continue
- it will try again or throw a fatal error.

So you will see it in the logs if a secondary had a failure
replicating from a functioning primary.

If you meant something else by replication failure, could you clear up
what exactly you're thinking of?

Asya


On Tue, Aug 25, 2015 at 10:31 PM, Karthik Bhat <karthi...@gmail.com> wrote:
> How to detect Replication failures between primary and secondary nodes in
> mongo (if any)? Can you please point me to the documentation?
>
> --
> You received this message because you are subscribed to the Google Groups
> "mongodb-user"
> group.
>
> For other MongoDB technical support options, see:
> http://www.mongodb.org/about/support/.
> ---
> You received this message because you are subscribed to the Google Groups
> "mongodb-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mongodb-user...@googlegroups.com.
> To post to this group, send email to mongod...@googlegroups.com.
> Visit this group at http://groups.google.com/group/mongodb-user.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mongodb-user/5ceeba85-9ba7-48e3-adb7-3fa0ad5ae23f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Karthik Bhat

unread,
Aug 31, 2015, 7:53:25 AM8/31/15
to mongodb-user
Thank you Asya. I wanted to check if an entry in oplog will be skipped if replication fails for that entry. If it keeps trying then that's great. If mongo were to throw a fatal error how would the log line look like? Can you please paste a log entry if that case were to happen?

Asya Kamsky

unread,
Sep 1, 2015, 1:54:58 AM9/1/15
to mongodb-user
> fatal error how would the log line look like? Can you
> please paste a log entry if that case were to happen?

I'm afraid I can't do that, there is not a single possible error,
there can be many.

Asya
> https://groups.google.com/d/msgid/mongodb-user/a9831061-b2ee-4008-99c6-679f36bfcf78%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages