[CSHARP-2087] InsertOne method stop working after one node of ReplicaSet goes down...! Created: 01/Nov/17  Updated: 14/Jun/19  Resolved: 06/Feb/19

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

Type: Task Priority: Major - P3
Reporter: MohammadReza Daghestani Assignee: Wan Bachtiar
Resolution: Done Votes: 0
Labels: question
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 10


Attachments: PNG File Capture.PNG     PNG File Capture.PNG    

 Description   

Hello,
First of all, I want to say sorry for my bad English.
I just set up a replica set containing three nodes and I wrote a code to test the downtime when one node gets down.
The console app starts running and suddenly I turned off the VPS that contains the primary node, after a while, another primary elected and compass connects again and starts working but my code stops working...! When I pause the visual studio it lights on the insert line. Actually, I think it hangs on insert line.
Should I do something to my code that it won't stop working after the primary goes down...!?
Here I attached my code.



 Comments   
Comment by Wan Bachtiar [ 04/Feb/19 ]

Should I do something to my code that it won't stop working after the primary goes down

Hi Mohammad,

Please see Retryable writes, which allow drivers to automatically retry certain write operations a single time if they encounter network errors, or if they cannot find a healthy primary in the replica sets or sharded cluster. This feature is available in MongoDB .NET/C# driver v2.5.

Please note that the CSHARP project is for reporting bugs or feature suggestions for the MongoDB .NET/C# driver. If you have any follow-up questions on the use of the driver, please post a question on mongodb-user group with relevant the information.

Regards,
Wan

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