Issue in Sharded cluster with replica set while data insertion

30 views
Skip to first unread message

dk9389

unread,
Sep 23, 2015, 7:18:21 AM9/23/15
to mongodb-user
We have deployed a replicated sharded cluster with 3 shards, each shard is a 3 member replica set(Primary,Secondary and Arbiter).
Also we are running 3 mongos and 3 config server instances. 
We are importing data in this cluster form SQL server using .net utility. While data insertion is in process and a step down of primary of replicaset of shard 1 happens and new primary is elected,then the insertion stops. Ideally it should not stop as shard 1 is a replica set and it is up and running,just a new primary is elected.
Can someone help me find out the reason for this.

Thnx

darshana kedare

unread,
Sep 23, 2015, 10:39:15 AM9/23/15
to mongod...@googlegroups.com
Hi Folks,

I got the issue, actually .net application is using MongoDB driver which by default uses Acknowledge as a write concern. So when the primary steps down MongoDB driver is not getting the write response from that primary and hence this error occurs.
Is there any way to change the default write concerns in MongoDB driver, or just skip the error "write results unavailable"
PFA Screenshot of the error.


--
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 a topic in the Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mongodb-user/_yYFXTheQos/unsubscribe.
To unsubscribe from this group and all its topics, 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/3c876080-3af4-43d3-af24-b5999e6a4ed8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Regards
Darshana Kedare
error.png

Stephen Steneker

unread,
Sep 24, 2015, 1:34:08 AM9/24/15
to mongodb-user
On Thursday, 24 September 2015 00:39:15 UTC+10, dk9389 wrote:
I got the issue, actually .net application is using MongoDB driver which by default uses Acknowledge as a write concern. So when the primary steps down MongoDB driver is not getting the write response from that primary and hence this error occurs.
Is there any way to change the default write concerns in MongoDB driver, or just skip the error "write results unavailable"

Hi Darshana,

If there is no primary available to accept writes, it is expected that your application will get write exceptions until a new primary is elected. In this case your application can choose to retry the write (perhaps with a backoff strategy) or ignore the exception with Unacknowledged writes (if it is acceptable to potentially not write data for your use case).


.. which maps to the standard MongoDB write concerns:

As you have noted, the default write concern is to request acknowledgement by the mongod that receives the write.

Regards,
Stephen
Reply all
Reply to author
Forward
0 new messages