Query regarding Replica set failover and high availability

43 views
Skip to first unread message

Ratish Puduppully

unread,
Jul 8, 2012, 3:13:40 PM7/8/12
to mongod...@googlegroups.com
Hi,
In case of a write-intensive application, I had some concerns regarding the time taken for a failover.
Going through the FAQ below and a similar post before, any writes which happen during the time the failover is in progress will be lost? This will cost writes of 10s to 1min.
Please confirm.
https://groups.google.com/d/msg/mongodb-user/lH3W5FtvMlw/iudHJh-P09EJ

What are the options available in such a scenario. One is to build backup options for the same in the application code.

Regards,
Ratish

Scott Hernandez

unread,
Jul 8, 2012, 3:25:03 PM7/8/12
to mongod...@googlegroups.com
Yes, you application will need to handle failures during writes (which would imply that you are doing safe writes -- WriteConcern.SAFE -- since you need to check if the write is not successful). If these writes fail because of a replica set fai-over that is just one common way, as well as temporary network issues but they all come down to something went wrong and you have to reconcile possibly incomplete writes.

--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb

Ratish Puduppully

unread,
Jul 9, 2012, 2:38:26 AM7/9/12
to mongod...@googlegroups.com
Thanks for the reply, Scott.
Yes, I am doing safe write-- WriteConcern.SAFE. 
So, in case of MongoException, I need to catch the server exception and handle it in the application.

Regards,
Ratish

Scott Hernandez

unread,
Jul 9, 2012, 4:41:38 AM7/9/12
to mongod...@googlegroups.com

Yes, you need to handle any exception during writes.

Reply all
Reply to author
Forward
0 new messages