<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:00:04 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-2471] Issue with slaveok failover for mongos</title>
                <link>https://jira.mongodb.org/browse/SERVER-2471</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Despite being set as slaveok, mongos seems unable to use slaves for queries once primary in replica set goes down.  Test which reproduces the issue attached, if test fails an error is thrown from the final two lines ( coll.findOne() ).  Further calls to coll.findOne() when test is run with load(&apos;shard_shutdown.js&apos;) and shell still open causes different connection timeout errors, assuming related.    &lt;/p&gt;

&lt;p&gt;Duplicated on multiple systems (ubuntu linux) but not reproducible everywhere, seems to be system-dependent. &lt;/p&gt;</description>
                <environment>Linux 2.6.35-25-generic #44-Ubuntu SMP Fri Jan 21 17:40:44 UTC 2011 x86_64 GNU/Linux&lt;br/&gt;
&lt;br/&gt;
</environment>
        <key id="14424">SERVER-2471</key>
            <summary>Issue with slaveok failover for mongos</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="greg_10gen">Greg Studer</assignee>
                                    <reporter username="greg_10gen">Greg Studer</reporter>
                        <labels>
                    </labels>
                <created>Wed, 2 Feb 2011 22:39:26 +0000</created>
                <updated>Tue, 12 Jul 2016 00:18:18 +0000</updated>
                            <resolved>Wed, 2 Mar 2011 17:16:43 +0000</resolved>
                                                                    <component>Replication</component>
                    <component>Sharding</component>
                    <component>Stability</component>
                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="25356" author="eliot" created="Sun, 6 Mar 2011 07:33:10 +0000"  >&lt;p&gt;Was there a commit for this?&lt;/p&gt;</comment>
                            <comment id="23273" author="greg_10gen" created="Mon, 7 Feb 2011 21:04:14 +0000"  >&lt;p&gt;Sequence of events:&lt;/p&gt;

&lt;p&gt;1.  Primary server in shard replica set goes down.&lt;br/&gt;
2.  Request for data from the shard hits a slave node b/c slaveOk set to true.&lt;br/&gt;
3.  Request for last error remembers the previous shard, checks out the replica set connection from the thread-local storage, but is hardcoded never to allow checks on the slaves.  Fails with error, never checks replica set connection back in.&lt;br/&gt;
4.  All further requests for data from the replica set (on that particular thread at least) fail, since it is impossible to establish a new connection to the replica set without all the nodes.  &lt;/p&gt;

&lt;p&gt;You can get the same effect with any command where slaveok is not true (for example, turning slaveok off than on again).  The error resets the thread-local connection, and new connections are not allowed when the replica set is down. &lt;/p&gt;
</comment>
                            <comment id="23127" author="greg_10gen" created="Fri, 4 Feb 2011 18:55:57 +0000"  >&lt;p&gt;getNextError is called by default when the output of the previous command is undefined ( actually the variable name &quot;db&quot; is hardcoded in, if you use another variable for your db you won&apos;t get this behavior ).  The query gets a cursor, but it seems like there is an issue populating the result variable from that cursor.  Looking into it.&lt;/p&gt;</comment>
                            <comment id="23103" author="eliot" created="Fri, 4 Feb 2011 04:54:47 +0000"  >&lt;p&gt;the shell shouldn&apos;t call getLastError for a findOne() ...  &lt;br/&gt;
Its only supposed to do that for writes?&lt;br/&gt;
Can you verify?&lt;/p&gt;</comment>
                            <comment id="23059" author="greg_10gen" created="Thu, 3 Feb 2011 18:15:40 +0000"  >&lt;p&gt;Error:&lt;/p&gt;

&lt;p&gt;Thu Feb  3 12:55:41 uncaught exception: getlasterror failed: {&lt;br/&gt;
	&quot;assertion&quot; : &quot;DBClientBase::findOne: transport error: ubuntu:31100 query: &lt;/p&gt;
{ getlasterror: 1.0, w: 1.0 }
&lt;p&gt;&quot;,&lt;br/&gt;
	&quot;assertionCode&quot; : 10276,&lt;br/&gt;
	&quot;errmsg&quot; : &quot;db assertion failure&quot;,&lt;br/&gt;
	&quot;ok&quot; : 0&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;On subsequent requests to coll.findOne():&lt;/p&gt;

&lt;p&gt;dbclient error communicating with server: ubuntu:31100&lt;/p&gt;

&lt;p&gt;Think I&apos;ve managed to track down what&apos;s happening - the query returns ok, but the subsequent default mongo shell call to getLastError fails to use slaveok.  This causes the assertation error and somehow borks the connection for further queries.  Hardcoding the slaveok flag in ClientInfo::getLastError seems to fix this, but not sure it&apos;s the best solution.&lt;/p&gt;</comment>
                            <comment id="23051" author="eliot" created="Thu, 3 Feb 2011 16:24:29 +0000"  >&lt;p&gt;Can you send output when you run this?&lt;br/&gt;
Seems to just hang for me.&lt;/p&gt;</comment>
                            <comment id="23018" author="greg_10gen" created="Thu, 3 Feb 2011 00:35:26 +0000"  >&lt;p&gt;Seems like a race condition.... shutting down, then waiting, then querying sometimes works.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="10760" name="shard_shutdown.js" size="4593" author="greg_10gen" created="Wed, 2 Feb 2011 22:39:26 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>7.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Thu, 3 Feb 2011 16:24:29 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 years, 50 weeks, 3 days 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>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 50 weeks, 3 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </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>eliot</customfieldvalue>
            <customfieldvalue>greg_10gen</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrp75j:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>20758</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </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>
                                

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

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