Replica set failover expectations

19 views
Skip to first unread message

karl

unread,
Aug 12, 2011, 10:14:44 AM8/12/11
to mongod...@googlegroups.com
I'm curious what the expected time from primary failure to secondary election is? 

I'm observing times in the 12-25 seconds, which seems a lot higher than I'd expect (yes, a majority exists). From looking at the logs, it appears that the primary going down is quickly detected, but that the process following that (possibly triggering the election) seems to be the problem.

The best place to observe this is to run some of the ruby mongodb tests (test/replica_sets/insert_test.rb for example).  The last time I ran this I got Rescue attempt 26: from Failed to connect to primary node...which means it took 26 seconds. running rs.status() during most of this period shows that the primary is down, but none of the 2 available secondaries get elected (and both arbiters are up too).


Scott Hernandez

unread,
Aug 12, 2011, 10:18:29 AM8/12/11
to mongod...@googlegroups.com
There are two things at play, when the replicaset elects the primary
and when the driver notices and acknowledges the new primary.

In 2.0 the election will speed up a good bit in certain cases. In the
end it can take 30s+ but most people seem to have sub 10s failover.

> --
> You received this message because you are subscribed to the Google Groups
> "mongodb-user" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/mongodb-user/-/w_utO_LpWAcJ.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to
> mongodb-user...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/mongodb-user?hl=en.
>

karl

unread,
Aug 12, 2011, 10:26:36 AM8/12/11
to mongod...@googlegroups.com
I'm connecting directly to a secondary and issuing rs.Status()   the driver picks it up pretty quickly...of the 26 seconds, the driver might take 1 or 2.

It really seems like, if you don't want to lose writes, you implement backup logic in the code, or you swap to a dynamo-backed solution (or something else). Even 10 seconds on a high-write app seems too significant to me..

Any talk, maybe in the 3.0 timeframe, to replace replica sets (or compliment them) with something that provides greater availability?
Reply all
Reply to author
Forward
0 new messages