<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:49:49 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[CSHARP-4934] Not automatically recovering after a failover</title>
                <link>https://jira.mongodb.org/browse/CSHARP-4934</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;h4&gt;&lt;a name=&quot;Summary&quot;&gt;&lt;/a&gt;Summary&lt;/h4&gt;

&lt;p&gt;After triggering a failover for an AWS document DB cluster with multiple nodes after the server recovers the C# driver does not work until restarted.&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;Pleaseprovidetheversionofthedriver.Ifapplicable%2CpleaseprovidetheMongoDBserverversionandtopology%28standalone%2Creplicaset%2Corshardedcluster%29.&quot;&gt;&lt;/a&gt;Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).&lt;/h4&gt;
&lt;h4&gt;&lt;a name=&quot;HowtoReproduce&quot;&gt;&lt;/a&gt;How to Reproduce&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;Driver version: &#160;2.23.1&lt;/em&gt;&lt;br/&gt;
&lt;em&gt;DB: AWS document DB, size intermediate with 3 nodes with the same priority&lt;/em&gt;&lt;br/&gt;
&lt;em&gt;Server: app runner instance in VPC with AWS DocumentDB from above.&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;Using C# driver above in an asp.net server deployed to AWS app runner configured as above&lt;br/&gt;
1. Have a server running and handling write requests&lt;br/&gt;
2. Using failover-db-cluster to trigger a failover event (&lt;a href=&quot;https://awscli.amazonaws.com/v2/documentation/api/latest/reference/rds/failover-db-cluster.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://awscli.amazonaws.com/v2/documentation/api/latest/reference/rds/failover-db-cluster.html&lt;/a&gt;)&lt;br/&gt;
3. Keep the server responding to requests&lt;br/&gt;
&#160;&lt;br/&gt;
Code used&lt;br/&gt;
&#160;&lt;br/&gt;
var settings = MongoClientSettings.FromUrl(new MongoUrl(connectionString));&lt;br/&gt;
_client = new MongoClient(settings);&lt;/p&gt;

&lt;p&gt;Put(&lt;span class=&quot;error&quot;&gt;&amp;#91;FromBody&amp;#93;&lt;/span&gt; TestDocument document)&lt;/p&gt;
{
&#160; await collection.InsertOneAsync(document);
}
&lt;p&gt;&#160;&lt;br/&gt;
Expected&lt;br/&gt;
Once the failover is complete it is expected that the server will be able to process requests again without restarting or recreating the mongo db client.&lt;br/&gt;
&#160;&lt;br/&gt;
Actual&lt;br/&gt;
The server is not able to complete write requests again until restarted.&lt;br/&gt;
Other servers can connect and write afterward.&lt;br/&gt;
&#160;&lt;br/&gt;
Workaround&lt;br/&gt;
The only way I found to automatically recover was to recreate the client with different settings then recovers after the fall over&lt;/p&gt;
&lt;h4&gt;&lt;a name=&quot;AdditionalBackground&quot;&gt;&lt;/a&gt;Additional Background&lt;/h4&gt;

&lt;p&gt;Connection string options ssl=false&amp;amp;retryWrites=false&amp;amp;readPreference=SecondaryPreferred&lt;/p&gt;</description>
                <environment></environment>
        <key id="2547244">CSHARP-4934</key>
            <summary>Not automatically recovering after a failover</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="10300" iconUrl="https://jira.mongodb.org/images/icons/priorities/medium.svg">Unknown</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="13202">Works as Designed</resolution>
                                        <assignee username="james.kovacs@mongodb.com">James Kovacs</assignee>
                                    <reporter username="tim.mcgrath@objective.com">tim mcgrath</reporter>
                        <labels>
                    </labels>
                <created>Wed, 17 Jan 2024 03:05:03 +0000</created>
                <updated>Wed, 24 Jan 2024 19:39:42 +0000</updated>
                            <resolved>Wed, 24 Jan 2024 18:15:00 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="6038881" author="JIRAUSER1276620" created="Wed, 24 Jan 2024 19:39:42 +0000"  >&lt;p&gt;Ok, thank you for looking into it for me.&lt;/p&gt;</comment>
                            <comment id="6038563" author="james.kovacs" created="Wed, 24 Jan 2024 18:14:47 +0000"  >&lt;p&gt;Hi, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=tim.mcgrath%40objective.com&quot; class=&quot;user-hover&quot; rel=&quot;tim.mcgrath@objective.com&quot;&gt;tim.mcgrath@objective.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thank you for reporting this issue. When connected to a MongoDB cluster - either self-hosted or MongoDB Atlas - the .NET/C# Driver recovers successfully after failover events. Our test suite verifies a variety of failover scenarios. If rediscovery of the cluster primary is not successful when connected to AWS DocumentDB, that indicates a problem with AWS DocumentDB not emitting the expected responses to heartbeats. I would suggest logging &lt;tt&gt;MongoClient.Cluster.Description&lt;/tt&gt; to compare the driver&apos;s view of the cluster topology with the current state of the cluster.&lt;/p&gt;

&lt;p&gt;If you can reproduce this behaviour when connected to a self-hosted MongoDB cluster or MongoDB Atlas, we would be happy to investigate further. If this problem is specific to AWS DocumentDB, then please contact Amazon technical support to investigate further.&lt;/p&gt;

&lt;p&gt;Sincerely,&lt;br/&gt;
James&lt;/p&gt;</comment>
                            <comment id="6018690" author="JIRAUSER1276620" created="Wed, 17 Jan 2024 20:02:35 +0000"  >&lt;p&gt;Sorry should have been failover rather the fall over and doesn&apos;t seem like I can edit the issue&lt;/p&gt;</comment>
                            <comment id="6016215" author="dbeng-pm-bot" created="Wed, 17 Jan 2024 03:05:06 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=tim.mcgrath%40objective.com&quot; class=&quot;user-hover&quot; rel=&quot;tim.mcgrath@objective.com&quot;&gt;tim.mcgrath@objective.com&lt;/a&gt;, thank you for reporting this issue! The team will look into it and get back to you soon. &lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                        <customfield id="customfield_23812" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Assigned Team</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="26445"><![CDATA[Dotnet Drivers]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_14266" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Documentation Changes Summary</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;p&gt;1.  What would you like to communicate to the user about this feature?&lt;br/&gt;
2.  Would you like the user to see examples of the syntax and/or executable code and its output?&lt;br/&gt;
3.  Which versions of the driver/connector does this apply to?&lt;/p&gt;</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|i2q5ws:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>