[CSHARP-1422] MongoDB driver failed with writeconcern error Created: 24/Sep/15  Updated: 16/Nov/21  Resolved: 28/Sep/15

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Minor - P4
Reporter: darshana kedare Assignee: Craig Wilson
Resolution: Done Votes: 0
Labels: question
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

AWS


Attachments: PNG File error.png    

 Description   

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 service. This service uses MongoDB driver for .net. When we step down one of the primary, arbiter elects new primary and the cluster is up and running, but the MongoDB driver in the service waits for the write concern response from the previous primary, and gets timed out after some time.
Screen shot of the error from .net service is attached.

MongoDB version is 3.0.6 and storage engine is wiredTiger



 Comments   
Comment by darshana kedare [ 28/Sep/15 ]

Thanks Craig
We will build the application with retry logic..

Darshana

Comment by Craig Wilson [ 24/Sep/15 ]

Hi Darshana,

Sorry you are having troubles. Just because MongoDB supports automatic failover does not mean you will not receive errors. Likely, what happened here is that a write was in process at the same time the failover was occurring. As such, you received a write concern error. It is your responsibility to handle an error like this and decide what to do with it. Either retry the operation or note in your logs somewhere for someone to follow-up on.

Craig

Generated at Wed Feb 07 21:39:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.