<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:54:16 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>[JAVA-1298] secondary readPrefs require a primary in the replica-set to retrieve more than 101 results</title>
                <link>https://jira.mongodb.org/browse/JAVA-1298</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;getMore command behind DBCursor.hasNext appears to require that a primary exists in the replica-set somewhere. It does not require a connection to it (AFAIK) but it insists that a primary be nominated.&lt;/p&gt;

&lt;p&gt;Reproduction:&lt;br/&gt;
1. Set up a 3 node replica-set (PSS).&lt;br/&gt;
2. Kill 2 nodes.&lt;br/&gt;
3. Run Java client with a readPreference of secondary and perform a simple query.&lt;br/&gt;
4. Call hasNext on the returned cursor until 101 results.&lt;br/&gt;
5. Stack trace follows:&lt;/p&gt;

&lt;p&gt;Caused by: com.mongodb.MongoException: can&apos;t find a master&lt;br/&gt;
	at com.mongodb.DBTCPConnector.checkMaster(DBTCPConnector.java:517)&lt;br/&gt;
	at &lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/blob/2.11.x/src/main/com/mongodb/DBTCPConnector.java#L236&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:236)&lt;/a&gt;&lt;br/&gt;
	at &lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/blob/2.11.x/src/main/com/mongodb/DBTCPConnector.java#L216&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216)&lt;/a&gt;&lt;br/&gt;
	at &lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/blob/2.11.x/src/main/com/mongodb/DBTCPConnector.java#L184&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;com.mongodb.DBTCPConnector.call(DBTCPConnector.java:184)&lt;/a&gt;&lt;br/&gt;
	at com.mongodb.DBApiLayer$Result._advance(DBApiLayer.java:427)&lt;br/&gt;
	at com.mongodb.DBApiLayer$Result.hasNext(DBApiLayer.java:396)&lt;br/&gt;
	at com.mongodb.DBCursor._hasNext(DBCursor.java:464)&lt;br/&gt;
	at com.mongodb.DBCursor.hasNext(DBCursor.java:484)&lt;/p&gt;


&lt;p&gt;It would seem the first &lt;tt&gt;DBTCPConnnector.call&lt;/tt&gt; passes &quot;null&quot; as a readPref to the counterpart which dutifully passes that through to &lt;tt&gt;DBTCPConnector.innerCall&lt;/tt&gt; which defaults to primary (because null readpref) and the getMore helper has constructed an OutMessage instance with no readpref either. Thus &lt;tt&gt;checkMaster&lt;/tt&gt; is erroneously called with &quot;true&quot; for &quot;failIfNoMaster&quot;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="144777">JAVA-1298</key>
            <summary>secondary readPrefs require a primary in the replica-set to retrieve more than 101 results</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="3">Duplicate</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="andrew.ryder@mongodb.com">Andrew Ryder</reporter>
                        <labels>
                    </labels>
                <created>Tue, 1 Jul 2014 06:10:14 +0000</created>
                <updated>Wed, 13 Apr 2016 20:59:45 +0000</updated>
                            <resolved>Wed, 13 Apr 2016 20:58:26 +0000</resolved>
                                    <version>2.11.0</version>
                                    <fixVersion>2.12.0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="645952" author="jeff.yemin" created="Wed, 2 Jul 2014 15:18:07 +0000"  >&lt;p&gt;This bug has been fixed in the 2.12 release as part of other larger changes to the driver, and currently we don&apos;t plan to backport to 2.11.&lt;/p&gt;</comment>
                            <comment id="640966" author="jeff.yemin" created="Tue, 1 Jul 2014 19:28:07 +0000"  >&lt;p&gt;I reproduced the bug in 2.11.4, but it&apos;s fixed in 2.12.2.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <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|hs0507:</customfieldvalue>

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