<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 04:12:36 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>[SERVER-26590] No primary, insert through mongoS hangs for 15 seconds before failing</title>
                <link>https://jira.mongodb.org/browse/SERVER-26590</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;In Mongo 3.2.10, when trying to insert a new document via mongoS and the underlying replicaset has no primary, the write hangs for about 15 seconds before failing with a &quot;could not contact primary for replica set&quot; error.&lt;/p&gt;

&lt;p&gt;The error is expected. What&apos;s not expected is that it takes 15 seconds for mongoS to return that error. In Mongo 3.0.4, the insert fails immediately.&lt;/p&gt;</description>
                <environment></environment>
        <key id="322937">SERVER-26590</key>
            <summary>No primary, insert through mongoS hangs for 15 seconds before failing</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</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="9">Done</resolution>
                                        <assignee username="kelsey.schubert@mongodb.com">Kelsey Schubert</assignee>
                                    <reporter username="alessandro.gherardi@yahoo.com">Alessandro Gherardi</reporter>
                        <labels>
                    </labels>
                <created>Wed, 12 Oct 2016 03:37:18 +0000</created>
                <updated>Tue, 20 Dec 2016 10:08:55 +0000</updated>
                            <resolved>Thu, 13 Oct 2016 22:05:13 +0000</resolved>
                                    <version>3.2.10</version>
                                                                        <votes>0</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="1461941" author="salzamt" created="Tue, 20 Dec 2016 10:08:55 +0000"  >&lt;p&gt;hi kal,&lt;br/&gt;
thanks a lot for your answer, we will update our cluster then in order to avoid this problem in the future.&lt;br/&gt;
I like the &quot;giving a chance&quot; in general, but not on every query but only in the intermediate situation when a failover happens and afterwards holding the state somewhere.&lt;br/&gt;
thanks, riccardo&lt;/p&gt;</comment>
                            <comment id="1461016" author="kaloian.manassiev" created="Mon, 19 Dec 2016 14:38:30 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=salzamt&quot; class=&quot;user-hover&quot; rel=&quot;salzamt&quot;&gt;salzamt&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Unfortunately in version 3.2 there is no way to lower this wait time - it was added intentionally as a way of &quot;giving a chance&quot; to the shard&apos;s replica set to elect a primary or for the network condition to recover itself.&lt;/p&gt;

&lt;p&gt;In version 3.4 we added support on MongoS for enforcing maxTimeMS. If you specify a value lower than 15 seconds, the server will keep looking for primary for at most this value.&lt;/p&gt;

&lt;p&gt;Hope this helps.&lt;/p&gt;

&lt;p&gt;-Kal.&lt;/p&gt;</comment>
                            <comment id="1460598" author="salzamt" created="Sun, 18 Dec 2016 12:35:45 +0000"  >&lt;p&gt;Hi,&lt;br/&gt;
I just found this ticket because of investigations regarding a downtime on our production servers. Even though this is the expected behaviour, its a very bad practice to hold the response for some time even though you already know, it might fail. This will cause a lot of web applications to go down whenever a network error occurs if they have quiet some request throughput.&lt;/p&gt;

&lt;p&gt;Imagine following scenario:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;dns issue between only two nodes and only one direction.&lt;/li&gt;
	&lt;li&gt;mongos just cannot connect to one single primary of all primaries in the cluster and waits for 15 seconds.&lt;/li&gt;
	&lt;li&gt;in average, lets say with 500 requests/s, 500ms avg request time and 40 workers (uwsgi, pymongo, sharded cluster) working very fine. just 50 or the 500 requests per second would like to write to this one primary. instead of failing, the wait for 15 seconds so in like half a second, all workers are busy with waiting and all requests are queued in the request queue and timing out. nothing works, everything just waits.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;actually none really cares if those few requests would raise an exception but everything besides that would at least work. if those are very important, it needs to be handled in the code anyway.&lt;br/&gt;
so we really need to disable this &quot;feature&quot; otherwise we will go offline whenever a network issue occurs because of timeouts and blocked requests.&lt;br/&gt;
is there a way to disable or set this timeout manually?&lt;br/&gt;
also this state of blocking for 15 seconds makes sense in the first 15 seconds after a network issue occurs to wait for a new primary probably, but not forever, if there is no primary (actually there is, mongos is just not seeing it due to network and DNS issues) it should keep a state of the problem and and immediately return an error, not just check and hold on request / query time.&lt;br/&gt;
looking forward to a solution &lt;/p&gt;</comment>
                            <comment id="1408011" author="thomas.schubert" created="Thu, 13 Oct 2016 22:05:13 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=alessandro.gherardi%40yahoo.com&quot; class=&quot;user-hover&quot; rel=&quot;alessandro.gherardi@yahoo.com&quot;&gt;alessandro.gherardi@yahoo.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;This is expected behavior and was implemented by &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-21272&quot; title=&quot;All NotMaster and NetworkError retries should wait before retrying&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-21272&quot;&gt;&lt;del&gt;SERVER-21272&lt;/del&gt;&lt;/a&gt;. For shards backed by a replica set (including the config server), we will try for up to 15 seconds to locate a primary node and if none is found will fail.&lt;/p&gt;

&lt;p&gt;Kind regards,&lt;br/&gt;
Thomas&lt;/p&gt;</comment>
                            <comment id="1406023" author="thomas.schubert" created="Wed, 12 Oct 2016 06:45:33 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=alessandro.gherardi%40yahoo.com&quot; class=&quot;user-hover&quot; rel=&quot;alessandro.gherardi@yahoo.com&quot;&gt;alessandro.gherardi@yahoo.com&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thanks for reporting this behavior. We are investigating this issue and will update this ticket when we know more.&lt;/p&gt;

&lt;p&gt;Kind regards,&lt;br/&gt;
Thomas&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="237619">SERVER-21272</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 12 Oct 2016 06:45:33 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        7 years, 8 weeks, 1 day ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></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_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>salzamt</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            7 years, 8 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>alessandro.gherardi@yahoo.com</customfieldvalue>
            <customfieldvalue>kaloian.manassiev@mongodb.com</customfieldvalue>
            <customfieldvalue>kelsey.schubert@mongodb.com</customfieldvalue>
            <customfieldvalue>salzamt</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrjtk7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hsqqjr:</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>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10750" key="com.atlassian.jira.plugin.system.customfieldtypes:textarea">
                        <customfieldname>Steps To Reproduce</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>&lt;ul&gt;
	&lt;li&gt;Setup a Mongo 3.2.10 cluster with CSRS and 1 replicaset consisting of a single mongoD&lt;/li&gt;
	&lt;li&gt;Create a sharded collection&lt;/li&gt;
	&lt;li&gt;Connect to the mongoD and run db.getSiblingDB(&quot;admin&quot;).runCommand(
{replSetStepDown: 600, force: true}
&lt;p&gt;)&lt;/p&gt;&lt;/li&gt;
	&lt;li&gt;Connect to mongoS&lt;/li&gt;
	&lt;li&gt;Set rs.slaveOk()&lt;/li&gt;
	&lt;li&gt;Try to insert a document in the collection&lt;/li&gt;
	&lt;li&gt;The insert hangs for about 15 seconds then fails with &quot;could not contact primary for replica set&quot;&lt;/li&gt;
&lt;/ul&gt;

</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                    <customfieldvalue><![CDATA[kelsey.schubert@mongodb.com]]></customfieldvalue>
    

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrlgh3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>