<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:35:53 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-128] find(..) query with MongoServer.Create(&quot;...?slaveok=true&quot;)  will always throw &quot;not master&quot;</title>
                <link>https://jira.mongodb.org/browse/CSHARP-128</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;//begin code&lt;br/&gt;
var m = MongoServer.Create(&quot;mongodb://192.168.1.110:27117,192.168.1.112:27117/cache?replicaset=cacheset&amp;amp;slaveok=true&quot;);&lt;/p&gt;

&lt;p&gt;var col = m&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;cache&amp;quot;&amp;#93;&lt;/span&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;flatdoc&amp;quot;&amp;#93;&lt;/span&gt;;&lt;br/&gt;
var q = Query.In(&quot;_id&quot;, BsonArray.Create(new[] &lt;/p&gt;
{ 1,2,3 }
&lt;p&gt;));&lt;/p&gt;

&lt;p&gt;//this will throw: not master&lt;br/&gt;
var res = (from d in col.Find(q) select d).ToList();&lt;/p&gt;

&lt;p&gt;//this will also throw: not master&lt;br/&gt;
res = (from d in col.Find(q).SetFlags(QueryFlags.SlaveOk) select d).ToList();&lt;/p&gt;

&lt;p&gt;//end code&lt;br/&gt;
/*&lt;br/&gt;
The only way for this to not throw is to exclude slaveok=true from mongo url and&lt;br/&gt;
calling SetFlags(QueryFlags.SlaveOk) on the cursor before use.&lt;/p&gt;

&lt;p&gt;I hope this helps&lt;br/&gt;
*/&lt;/p&gt;</description>
                <environment>Windows 7 C# .net 3.5 driver version 10gen driver v0.9. &lt;br/&gt;
MongoDB server for linux version 1.6.3 running in a 2 nodes replica set with 2 arbiters (all running on centOS 5.5 VM)</environment>
        <key id="13885">CSHARP-128</key>
            <summary>find(..) query with MongoServer.Create(&quot;...?slaveok=true&quot;)  will always throw &quot;not master&quot;</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="robert@mongodb.com">Robert Stam</assignee>
                                    <reporter username="hnguye8">huy nguyen</reporter>
                        <labels>
                    </labels>
                <created>Tue, 7 Dec 2010 03:24:53 +0000</created>
                <updated>Thu, 2 Apr 2015 18:27:42 +0000</updated>
                            <resolved>Tue, 1 Feb 2011 15:07:16 +0000</resolved>
                                    <version>0.9</version>
                                    <fixVersion>0.11</fixVersion>
                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="22942" author="rstam" created="Tue, 1 Feb 2011 15:07:16 +0000"  >&lt;p&gt;Please reopen this issue if you are able to reproduce it.&lt;/p&gt;</comment>
                            <comment id="21833" author="rstam" created="Mon, 27 Dec 2010 23:34:55 +0000"  >&lt;p&gt;Are you still seeing this? The rs.status() looks normal. We would have to see the rs.status() values at the time of a failure.&lt;/p&gt;</comment>
                            <comment id="21146" author="hnguye8" created="Tue, 7 Dec 2010 17:58:47 +0000"  >&lt;p&gt;Just in case, here&apos;s the status of arbiter 1:&lt;/p&gt;

&lt;p&gt;connecting to: 192.168.1.110:27118/test&lt;br/&gt;
&amp;gt; rs.isMaster()&lt;br/&gt;
{&lt;br/&gt;
        &quot;setName&quot; : &quot;cacheset&quot;,&lt;br/&gt;
        &quot;ismaster&quot; : false,&lt;br/&gt;
        &quot;secondary&quot; : false,&lt;br/&gt;
        &quot;hosts&quot; : [&lt;br/&gt;
                &quot;192.168.1.112:27117&quot;,&lt;br/&gt;
                &quot;192.168.1.110:27117&quot;&lt;br/&gt;
        ],&lt;br/&gt;
        &quot;arbiters&quot; : [&lt;br/&gt;
                &quot;192.168.1.110:27118&quot;,&lt;br/&gt;
                &quot;192.168.1.112:27118&quot;&lt;br/&gt;
        ],&lt;br/&gt;
        &quot;primary&quot; : &quot;192.168.1.110:27117&quot;,&lt;br/&gt;
        &quot;arbiterOnly&quot; : true,&lt;br/&gt;
        &quot;ok&quot; : 1&lt;br/&gt;
}&lt;br/&gt;
&amp;gt; rs.status()&lt;br/&gt;
{&lt;br/&gt;
        &quot;set&quot; : &quot;cacheset&quot;,&lt;br/&gt;
        &quot;date&quot; : &quot;Tue Dec 07 2010 09:55:40 GMT-0800 (Pacific Standard Time)&quot;,&lt;br/&gt;
        &quot;myState&quot; : 7,&lt;br/&gt;
        &quot;members&quot; : [&lt;br/&gt;
                &lt;/p&gt;
{
                        &quot;_id&quot; : 2,
                        &quot;name&quot; : &quot;192.168.1.110:27117&quot;,
                        &quot;health&quot; : 1,
                        &quot;state&quot; : 1,
                        &quot;uptime&quot; : 2833486,
                        &quot;lastHeartbeat&quot; : &quot;Tue Dec 07 2010 09:55:40 GMT-0800 (Pacific Standard Time)&quot;
                }
&lt;p&gt;,&lt;br/&gt;
                &lt;/p&gt;
{
                        &quot;_id&quot; : 3,
                        &quot;name&quot; : &quot;vm-jcorb-1.docstoc.corp:27118&quot;,
                        &quot;health&quot; : 1,
                        &quot;state&quot; : 7,
                        &quot;self&quot; : true
                }
&lt;p&gt;,&lt;br/&gt;
                &lt;/p&gt;
{
                        &quot;_id&quot; : 4,
                        &quot;name&quot; : &quot;192.168.1.112:27118&quot;,
                        &quot;health&quot; : 1,
                        &quot;state&quot; : 7,
                        &quot;uptime&quot; : 4131052,
                        &quot;lastHeartbeat&quot; : &quot;Tue Dec 07 2010 09:55:39 GMT-0800 (Pacific Standard Time)&quot;
                }
&lt;p&gt;,&lt;/p&gt;
                {
                        &quot;_id&quot; : 5,
                        &quot;name&quot; : &quot;192.168.1.112:27117&quot;,
                        &quot;health&quot; : 1,
                        &quot;state&quot; : 2,
                        &quot;uptime&quot; : 2833354,
                        &quot;lastHeartbeat&quot; : &quot;Tue Dec 07 2010 09:55:39 GMT-0800 (Pacific Standard Time)&quot;
                }
&lt;p&gt;        ],&lt;br/&gt;
        &quot;ok&quot; : 1&lt;br/&gt;
}&lt;/p&gt;


&lt;p&gt;and for arbiter 2:&lt;/p&gt;

&lt;p&gt;connecting to: 192.168.1.112:27118/test&lt;br/&gt;
&amp;gt; rs.isMaster()&lt;br/&gt;
{&lt;br/&gt;
        &quot;setName&quot; : &quot;cacheset&quot;,&lt;br/&gt;
        &quot;ismaster&quot; : false,&lt;br/&gt;
        &quot;secondary&quot; : false,&lt;br/&gt;
        &quot;hosts&quot; : [&lt;br/&gt;
                &quot;192.168.1.112:27117&quot;,&lt;br/&gt;
                &quot;192.168.1.110:27117&quot;&lt;br/&gt;
        ],&lt;br/&gt;
        &quot;arbiters&quot; : [&lt;br/&gt;
                &quot;192.168.1.112:27118&quot;,&lt;br/&gt;
                &quot;192.168.1.110:27118&quot;&lt;br/&gt;
        ],&lt;br/&gt;
        &quot;primary&quot; : &quot;192.168.1.110:27117&quot;,&lt;br/&gt;
        &quot;arbiterOnly&quot; : true,&lt;br/&gt;
        &quot;ok&quot; : 1&lt;br/&gt;
}&lt;br/&gt;
&amp;gt; rs.status()&lt;br/&gt;
{&lt;br/&gt;
        &quot;set&quot; : &quot;cacheset&quot;,&lt;br/&gt;
        &quot;date&quot; : &quot;Tue Dec 07 2010 09:47:03 GMT-0800 (Pacific Standard Time)&quot;,&lt;br/&gt;
        &quot;myState&quot; : 7,&lt;br/&gt;
        &quot;members&quot; : [&lt;br/&gt;
                &lt;/p&gt;
{
                        &quot;_id&quot; : 2,
                        &quot;name&quot; : &quot;192.168.1.110:27117&quot;,
                        &quot;health&quot; : 1,
                        &quot;state&quot; : 1,
                        &quot;uptime&quot; : 2833166,
                        &quot;lastHeartbeat&quot; : &quot;Tue Dec 07 2010 09:47:02 GMT-0800 (Pacific Standard Time)&quot;
                }
&lt;p&gt;,&lt;br/&gt;
                &lt;/p&gt;
{
                        &quot;_id&quot; : 3,
                        &quot;name&quot; : &quot;192.168.1.110:27118&quot;,
                        &quot;health&quot; : 1,
                        &quot;state&quot; : 7,
                        &quot;uptime&quot; : 4130536,
                        &quot;lastHeartbeat&quot; : &quot;Tue Dec 07 2010 09:47:02 GMT-0800 (Pacific Standard Time)&quot;
                }
&lt;p&gt;,&lt;br/&gt;
                &lt;/p&gt;
{
                        &quot;_id&quot; : 4,
                        &quot;name&quot; : &quot;vm-sandbox-1.docstoc.local:27118&quot;,
                        &quot;health&quot; : 1,
                        &quot;state&quot; : 7,
                        &quot;self&quot; : true
                }
&lt;p&gt;,&lt;/p&gt;
                {
                        &quot;_id&quot; : 5,
                        &quot;name&quot; : &quot;192.168.1.112:27117&quot;,
                        &quot;health&quot; : 1,
                        &quot;state&quot; : 2,
                        &quot;uptime&quot; : 2833035,
                        &quot;lastHeartbeat&quot; : &quot;Tue Dec 07 2010 09:47:01 GMT-0800 (Pacific Standard Time)&quot;
                }
&lt;p&gt;        ],&lt;br/&gt;
        &quot;ok&quot; : 1&lt;br/&gt;
}&lt;/p&gt;
</comment>
                            <comment id="21145" author="hnguye8" created="Tue, 7 Dec 2010 17:54:13 +0000"  >&lt;p&gt;Robert,&lt;/p&gt;

&lt;p&gt;On the master of this replica (192.168.1.110:27117) set here is what I see:&lt;br/&gt;
&amp;gt; rs.isMaster()&lt;br/&gt;
{&lt;br/&gt;
        &quot;setName&quot; : &quot;cacheset&quot;,&lt;br/&gt;
        &quot;ismaster&quot; : true,&lt;br/&gt;
        &quot;secondary&quot; : false,&lt;br/&gt;
        &quot;hosts&quot; : [&lt;br/&gt;
                &quot;192.168.1.110:27117&quot;,&lt;br/&gt;
                &quot;192.168.1.112:27117&quot;&lt;br/&gt;
        ],&lt;br/&gt;
        &quot;arbiters&quot; : [&lt;br/&gt;
                &quot;192.168.1.112:27118&quot;,&lt;br/&gt;
                &quot;192.168.1.110:27118&quot;&lt;br/&gt;
        ],&lt;br/&gt;
        &quot;ok&quot; : 1&lt;br/&gt;
}&lt;br/&gt;
&amp;gt; rs.status()&lt;br/&gt;
{&lt;br/&gt;
        &quot;set&quot; : &quot;cacheset&quot;,&lt;br/&gt;
        &quot;date&quot; : &quot;Tue Dec 07 2010 09:43:59 GMT-0800 (Pacific Standard Time)&quot;,&lt;br/&gt;
        &quot;myState&quot; : 1,&lt;br/&gt;
        &quot;members&quot; : [&lt;br/&gt;
                &lt;/p&gt;
{
                        &quot;_id&quot; : 2,
                        &quot;name&quot; : &quot;vm-jcorb-1.docstoc.corp:27117&quot;,
                        &quot;health&quot; : 1,
                        &quot;state&quot; : 1,
                        &quot;self&quot; : true
                }
&lt;p&gt;,&lt;br/&gt;
                &lt;/p&gt;
{
                        &quot;_id&quot; : 3,
                        &quot;name&quot; : &quot;192.168.1.110:27118&quot;,
                        &quot;health&quot; : 1,
                        &quot;state&quot; : 7,
                        &quot;uptime&quot; : 2832784,
                        &quot;lastHeartbeat&quot; : &quot;Tue Dec 07 2010 09:43:59 GMT-0800 (Pacific Standard Time)&quot;
                }
&lt;p&gt;,&lt;br/&gt;
                &lt;/p&gt;
{
                        &quot;_id&quot; : 4,
                        &quot;name&quot; : &quot;192.168.1.112:27118&quot;,
                        &quot;health&quot; : 1,
                        &quot;state&quot; : 7,
                        &quot;uptime&quot; : 2832784,
                        &quot;lastHeartbeat&quot; : &quot;Tue Dec 07 2010 09:43:58 GMT-0800 (Pacific Standard Time)&quot;
                }
&lt;p&gt;,&lt;/p&gt;
                {
                        &quot;_id&quot; : 5,
                        &quot;name&quot; : &quot;192.168.1.112:27117&quot;,
                        &quot;health&quot; : 1,
                        &quot;state&quot; : 2,
                        &quot;uptime&quot; : 2832654,
                        &quot;lastHeartbeat&quot; : &quot;Tue Dec 07 2010 09:43:58 GMT-0800 (Pacific Standard Time)&quot;
                }
&lt;p&gt;        ],&lt;br/&gt;
        &quot;ok&quot; : 1&lt;br/&gt;
}&lt;br/&gt;
&amp;gt; db.stats()&lt;br/&gt;
{&lt;br/&gt;
        &quot;collections&quot; : 5,&lt;br/&gt;
        &quot;objects&quot; : 6607461,&lt;br/&gt;
        &quot;avgObjSize&quot; : 660.6603565272652,&lt;br/&gt;
        &quot;dataSize&quot; : 4365287540,&lt;br/&gt;
        &quot;storageSize&quot; : 4686907392,&lt;br/&gt;
        &quot;numExtents&quot; : 32,&lt;br/&gt;
        &quot;indexes&quot; : 7,&lt;br/&gt;
        &quot;indexSize&quot; : 2059685632,&lt;br/&gt;
        &quot;fileSize&quot; : 10666115072,&lt;br/&gt;
        &quot;ok&quot; : 1&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;On the slave (192.168.1.112:27117), I see this:&lt;/p&gt;

&lt;p&gt;&amp;gt; rs.isMaster()&lt;br/&gt;
{&lt;br/&gt;
        &quot;setName&quot; : &quot;cacheset&quot;,&lt;br/&gt;
        &quot;ismaster&quot; : false,&lt;br/&gt;
        &quot;secondary&quot; : true,&lt;br/&gt;
        &quot;hosts&quot; : [&lt;br/&gt;
                &quot;192.168.1.112:27117&quot;,&lt;br/&gt;
                &quot;192.168.1.110:27117&quot;&lt;br/&gt;
        ],&lt;br/&gt;
        &quot;arbiters&quot; : [&lt;br/&gt;
                &quot;192.168.1.112:27118&quot;,&lt;br/&gt;
                &quot;192.168.1.110:27118&quot;&lt;br/&gt;
        ],&lt;br/&gt;
        &quot;primary&quot; : &quot;192.168.1.110:27117&quot;,&lt;br/&gt;
        &quot;ok&quot; : 1&lt;br/&gt;
}&lt;br/&gt;
&amp;gt; rs.status()&lt;br/&gt;
{&lt;br/&gt;
        &quot;set&quot; : &quot;cacheset&quot;,&lt;br/&gt;
        &quot;date&quot; : &quot;Tue Dec 07 2010 09:41:41 GMT-0800 (Pacific Standard Time)&quot;,&lt;br/&gt;
        &quot;myState&quot; : 2,&lt;br/&gt;
        &quot;members&quot; : [&lt;br/&gt;
                &lt;/p&gt;
{
                        &quot;_id&quot; : 2,
                        &quot;name&quot; : &quot;192.168.1.110:27117&quot;,
                        &quot;health&quot; : 1,
                        &quot;state&quot; : 1,
                        &quot;uptime&quot; : 2832712,
                        &quot;lastHeartbeat&quot; : &quot;Tue Dec 07 2010 09:41:40 GMT-0800 (Pacific Standard Time)&quot;
                }
&lt;p&gt;,&lt;br/&gt;
                &lt;/p&gt;
{
                        &quot;_id&quot; : 3,
                        &quot;name&quot; : &quot;192.168.1.110:27118&quot;,
                        &quot;health&quot; : 1,
                        &quot;state&quot; : 7,
                        &quot;uptime&quot; : 2832712,
                        &quot;lastHeartbeat&quot; : &quot;Tue Dec 07 2010 09:41:40 GMT-0800 (Pacific Standard Time)&quot;
                }
&lt;p&gt;,&lt;br/&gt;
                &lt;/p&gt;
{
                        &quot;_id&quot; : 4,
                        &quot;name&quot; : &quot;192.168.1.112:27118&quot;,
                        &quot;health&quot; : 1,
                        &quot;state&quot; : 7,
                        &quot;uptime&quot; : 2832712,
                        &quot;lastHeartbeat&quot; : &quot;Tue Dec 07 2010 09:41:39 GMT-0800 (Pacific Standard Time)&quot;
                }
&lt;p&gt;,&lt;/p&gt;
                {
                        &quot;_id&quot; : 5,
                        &quot;name&quot; : &quot;vm-sandbox-1.docstoc.local:27117&quot;,
                        &quot;health&quot; : 1,
                        &quot;state&quot; : 2,
                        &quot;self&quot; : true
                }
&lt;p&gt;        ],&lt;br/&gt;
        &quot;ok&quot; : 1&lt;br/&gt;
}&lt;br/&gt;
&amp;gt; db.stats()&lt;br/&gt;
{&lt;br/&gt;
        &quot;collections&quot; : 5,&lt;br/&gt;
        &quot;objects&quot; : 6607461,&lt;br/&gt;
        &quot;avgObjSize&quot; : 668.0890799052768,&lt;br/&gt;
        &quot;dataSize&quot; : 4414372540,&lt;br/&gt;
        &quot;storageSize&quot; : 6874664448,&lt;br/&gt;
        &quot;numExtents&quot; : 37,&lt;br/&gt;
        &quot;indexes&quot; : 7,&lt;br/&gt;
        &quot;indexSize&quot; : 1850229696,&lt;br/&gt;
        &quot;fileSize&quot; : 12812550144,&lt;br/&gt;
        &quot;ok&quot; : 1&lt;br/&gt;
}&lt;/p&gt;


&lt;p&gt;I will continue to investigate this issue on my side (reboot all the mongo nodes) and do additional tests. I&apos;ll keep you posted.&lt;/p&gt;

&lt;p&gt;--Huy&lt;/p&gt;</comment>
                            <comment id="21140" author="rstam" created="Tue, 7 Dec 2010 15:01:26 +0000"  >&lt;p&gt;I cannot reproduce this. I have a similar test program with a 2 node replica set, and verified just now that it is still working (that reads are routed to the secondary and that no exception is thrown).&lt;/p&gt;

&lt;p&gt;When you remove &quot;slaveok=true&quot; from the URL it no longer uses the secondaries at all (even if you set SlaveOk on the cursor). So I suspect your secondary may be in some unusual state that is preventing it from responding to queries.&lt;/p&gt;

&lt;p&gt;Can you repeat this test and call &quot;rs.status()&quot; from the mongo shell (from two shells actually, one for each node) so that we can see what state the replica set nodes are in? I don&apos;t think we need the state of the arbiters, but it wouldn&apos;t hurt.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrh9j3:</customfieldvalue>

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